Click here to Skip to main content
15,915,828 members
Home / Discussions / WPF
   

WPF

 
QuestionWPF "Skinning" Pin
Steve The Plant2-Apr-09 10:23
Steve The Plant2-Apr-09 10:23 
AnswerRe: WPF "Skinning" Pin
Pete O'Hanlon3-Apr-09 4:01
mvePete O'Hanlon3-Apr-09 4:01 
GeneralRe: WPF "Skinning" Pin
Steve The Plant3-Apr-09 4:10
Steve The Plant3-Apr-09 4:10 
GeneralRe: WPF "Skinning" Pin
Pete O'Hanlon3-Apr-09 4:18
mvePete O'Hanlon3-Apr-09 4:18 
QuestionWPF Printing Fuzzy Pin
JensMig2-Apr-09 10:19
JensMig2-Apr-09 10:19 
QuestionXmlDataProvider Pin
mikla5212-Apr-09 6:13
mikla5212-Apr-09 6:13 
AnswerRe: XmlDataProvider Pin
hb521342142-Apr-09 11:37
hb521342142-Apr-09 11:37 
AnswerRe: XmlDataProvider Pin
Pete O'Hanlon2-Apr-09 22:18
mvePete O'Hanlon2-Apr-09 22:18 
AnswerRe: XmlDataProvider Pin
ABitSmart2-Apr-09 23:28
ABitSmart2-Apr-09 23:28 
GeneralRe: XmlDataProvider Pin
mikla5215-Apr-09 1:45
mikla5215-Apr-09 1:45 
QuestionWhy does WPF ignore stuff? Pin
RugbyLeague2-Apr-09 4:09
RugbyLeague2-Apr-09 4:09 
AnswerRe: Why does WPF ignore stuff? Pin
Pete O'Hanlon2-Apr-09 4:42
mvePete O'Hanlon2-Apr-09 4:42 
GeneralRe: Why does WPF ignore stuff? Pin
RugbyLeague2-Apr-09 4:46
RugbyLeague2-Apr-09 4:46 
AnswerRe: Why does WPF ignore stuff? Pin
Mark Salsbery2-Apr-09 5:35
Mark Salsbery2-Apr-09 5:35 
GeneralRe: Why does WPF ignore stuff? Pin
RugbyLeague2-Apr-09 5:39
RugbyLeague2-Apr-09 5:39 
GeneralRe: Why does WPF ignore stuff? Pin
Mark Salsbery2-Apr-09 5:49
Mark Salsbery2-Apr-09 5:49 
GeneralRe: Why does WPF ignore stuff? Pin
RugbyLeague2-Apr-09 5:51
RugbyLeague2-Apr-09 5:51 
QuestionUse .XAP file in ASP.Net Website Pin
pavanip2-Apr-09 2:42
pavanip2-Apr-09 2:42 
AnswerRe: Use .XAP file in ASP.Net Website Pin
Mark Salsbery2-Apr-09 5:21
Mark Salsbery2-Apr-09 5:21 
QuestionWPF codes to play a RTSP multicast or unicast video stream Pin
jklanka1-Apr-09 21:48
jklanka1-Apr-09 21:48 
QuestionKeep element in canvas when dragging it Pin
Pauwels Bart1-Apr-09 20:19
Pauwels Bart1-Apr-09 20:19 
AnswerRe: Keep element in canvas when dragging it Pin
ABitSmart1-Apr-09 21:17
ABitSmart1-Apr-09 21:17 
QuestionRe: Keep element in canvas when dragging it Pin
Pauwels Bart1-Apr-09 23:30
Pauwels Bart1-Apr-09 23:30 
I hadn't tried it before but ClipToBounds doesn't work.

When I add a new UIElement (like an image) to the Canvas, I adorn it. That adorner adds a Thumb to each side of the UIElement and that thumbs handles the drag function.


// Handler for moving.
private void HandleMove(object sender, DragDeltaEventArgs args)
{
    // Horizontal position.
    if (StanagCanvas.GetLeft(this.AdornedElement) + args.HorizontalChange < 0)
    {
        // Crossing left boundary.
        StanagCanvas.SetLeft(this.AdornedElement, 0);
    }
    else if (StanagCanvas.GetRight(this.AdornedElement) - args.HorizontalChange < 0)
    {
        // Crossing right boundary.
        StanagCanvas.SetRight(this.AdornedElement, 0);
    }
    else
    {
        StanagCanvas.SetLeft(this.AdornedElement, StanagCanvas.GetLeft(this.AdornedElement) + args.HorizontalChange);
    }

    // Vertical position.
    if (StanagCanvas.GetTop(this.AdornedElement) + args.VerticalChange < 0)
    {
        // Crossing top boundary.
        StanagCanvas.SetTop(this.AdornedElement, 0);
    }
    else if (StanagCanvas.GetBottom(this.AdornedElement) - args.VerticalChange < 0)
    {
        // Crossing bottom boundary.
        StanagCanvas.SetBottom(this.AdornedElement, 0);
    }
    else
    {
        StanagCanvas.SetTop(this.AdornedElement, StanagCanvas.GetTop(this.AdornedElement) + args.VerticalChange);
    }
}

(StanagCanvas derives from Canvas)

Offcourse the Right and Bottom properties don't work because I allready use the Left and Top properties. The element doesn't cross the left and top boundery of the canvas.

I hope this is enough information.
AnswerRe: Keep element in canvas when dragging it Pin
ABitSmart2-Apr-09 5:05
ABitSmart2-Apr-09 5:05 
QuestionRe: Keep element in canvas when dragging it Pin
Pauwels Bart2-Apr-09 7:22
Pauwels Bart2-Apr-09 7:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.