コード例 #1
0
ファイル: StageControl.xaml.cs プロジェクト: tp-nscan/archean
 void StageControl_SizeChanged(object sender, SizeChangedEventArgs e)
 {
     if (StageVm == null)
     {
         return;
     }
     Dispatcher.BeginInvoke(
         DispatcherPriority.Normal,
         new Action(() =>
     {
         Width = ActualHeight * StageVm.WidthToHeight();
         InvalidateVisual();
     }));
 }
コード例 #2
0
ファイル: StageControl.xaml.cs プロジェクト: tp-nscan/archean
        async void OnRenderTimerElapsed(object sender, ElapsedEventArgs e)
        {
            await Dispatcher.InvokeAsync(() =>
            {
                InvalidateVisual();

                if (ticks == TicsPerStep)
                {
                    ticks = 0;
                    StopTimer();
                    StageVm.RaiseAnimationFinished();
                }
                else
                {
                    ticks++;
                }
            });
        }
コード例 #3
0
ファイル: StageControl.xaml.cs プロジェクト: tp-nscan/archean
        protected override void OnRender(DrawingContext dc)
        {
            if (StageVm == null)
            {
                return;
            }

            Width = ActualHeight * StageVm.WidthToHeight();

            dc.DrawRectangle(StageVm.StageVmStyle.BackgroundBrush, null, new Rect(0.0, 0.0, ActualWidth, ActualHeight));

            dc.DrawKeyLines(StageVm.StageVmStyle, ActualWidth, ActualHeight);

            foreach (var kvm in StageVm.KeyPairVms)
            {
                dc.DrawSwitch(StageVm.StageVmStyle, StageVm.Order, kvm, ActualWidth, ActualHeight);
            }

            dc.DrawSortableValuesAnimate(StageVm.SortableVm, ActualWidth, ActualHeight);
        }
コード例 #4
0
ファイル: StageControl.xaml.cs プロジェクト: tp-nscan/archean
        protected override void OnRender(DrawingContext dc)
        {
            if (StageVm == null)
            {
                return;
            }
            dc.DrawRectangle(StageVm.StageVmStyle.BackgroundBrush, null, new Rect(0.0, 0.0, ActualWidth, ActualHeight));

            dc.DrawKeyLines(StageVm, ActualWidth, ActualHeight);

            foreach (var kvm in StageVm.KeyPairVms)
            {
                dc.DrawSwitch(StageVm, kvm, ActualWidth, ActualHeight);
            }

            if ((RenderTimer != null) && (RenderTimer.Enabled))
            {
                StageVm.DrawSortableValuesAnimate(ticks / TicsPerStep, dc, ActualWidth, ActualHeight);
            }
            else
            {
                StageVm.DrawSortableValues(dc, ActualWidth, ActualHeight);
            }
        }