Click here to Skip to main content
15,887,283 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Get Info Pin
Mycroft Holmes8-Oct-15 20:26
professionalMycroft Holmes8-Oct-15 20:26 
Questionsetting image in nested menu Pin
HailStorm26-Oct-15 4:05
HailStorm26-Oct-15 4:05 
AnswerRe: setting image in nested menu Pin
Pete O'Hanlon6-Oct-15 4:30
mvePete O'Hanlon6-Oct-15 4:30 
GeneralRe: setting image in nested menu Pin
HailStorm26-Oct-15 19:26
HailStorm26-Oct-15 19:26 
GeneralRe: setting image in nested menu Pin
Pete O'Hanlon6-Oct-15 21:01
mvePete O'Hanlon6-Oct-15 21:01 
AnswerRe: setting image in nested menu Pin
Richard Deeming6-Oct-15 5:16
mveRichard Deeming6-Oct-15 5:16 
QuestionAvalon 2.0 with MVVM and 2 anchorable panes Pin
marc borgers1-Oct-15 7:10
marc borgers1-Oct-15 7:10 
QuestionNeed Some Help With This Design Pin
Kevin Marois22-Sep-15 5:42
professionalKevin Marois22-Sep-15 5:42 
Overview
I'm writing this Timeline user control[^]

It's internal design looks like this
[^]

Question
There is a timer that moves the InnerCanvas to the left at regular intervals. This is Live mode.

The Now line is a child of the InnerCanvas, so that when the user slides it, the Now line will move also. Once the user slides the InnerCanvas, the control is then in History Mode. A History line appears when the Now line is and the Now line moves right with the timer ticks. So basically the user can see where Now WAS and where it IS relative to the slide amount.

In addition, in Live Mode, when the Now line is 3/4 of the way into the current period (1 Day, 3 Days, 5 Days), then an additional period is added to the right.

The problem is that in Live Mode, the now line should ALWAYS be 200 relative to the right side of the OutterCanvas.

There's got to be a way to know, regardless of the size or position of the InnerCanvas, to position it there.

My first pass was this
private void setupNowLine(double distanceToMove = 0)
{
    // Get the left of the inner container
    double left = Canvas.GetLeft(innerCanvas);

    if (distanceToMove == 0)
    {
        distanceToMove = left - originalInnerCanvasLeft;
    }

    // Recalulcate the new position
    nowLinePosition = (INNER_CANVAS_WIDTH + distanceToMove) - NOW_LINE_POSITION;

    // Position the Now line
    Canvas.SetLeft(nowLine, nowLinePosition);
}

But it doesn't work. For the life of me I can't get the calculations right. I could use some help here.

Thanks
If it's not broken, fix it until it is

SuggestionRe: Need Some Help With This Design Pin
Richard Deeming22-Sep-15 6:10
mveRichard Deeming22-Sep-15 6:10 
GeneralRe: Need Some Help With This Design Pin
Kevin Marois22-Sep-15 6:32
professionalKevin Marois22-Sep-15 6:32 
QuestionStopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs22-Sep-15 0:43
Saurabh18cs22-Sep-15 0:43 
AnswerRe: Stopping resizing of usercontrol and grid cell visibility Pin
Gerry Schmitz23-Sep-15 8:21
mveGerry Schmitz23-Sep-15 8:21 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs23-Sep-15 16:28
Saurabh18cs23-Sep-15 16:28 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Gerry Schmitz24-Sep-15 6:56
mveGerry Schmitz24-Sep-15 6:56 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs24-Sep-15 21:47
Saurabh18cs24-Sep-15 21:47 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Gerry Schmitz24-Sep-15 22:54
mveGerry Schmitz24-Sep-15 22:54 
SuggestionRe: Stopping resizing of usercontrol and grid cell visibility Pin
J. Calhoun24-Sep-15 7:45
J. Calhoun24-Sep-15 7:45 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs24-Sep-15 21:50
Saurabh18cs24-Sep-15 21:50 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
J. Calhoun25-Sep-15 2:14
J. Calhoun25-Sep-15 2:14 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs25-Sep-15 20:06
Saurabh18cs25-Sep-15 20:06 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
J. Calhoun28-Sep-15 3:06
J. Calhoun28-Sep-15 3:06 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs29-Sep-15 0:13
Saurabh18cs29-Sep-15 0:13 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
J. Calhoun29-Sep-15 3:38
J. Calhoun29-Sep-15 3:38 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs29-Sep-15 17:28
Saurabh18cs29-Sep-15 17:28 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
J. Calhoun30-Sep-15 3:11
J. Calhoun30-Sep-15 3:11 

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.