Beispiel #1
0
 public NotifyWindow(Rectangle area, ProtectEyesViewModel protectEyesViewModel)
 {
     this.protectEyesViewModel = protectEyesViewModel;
     Area        = area;
     DataContext = new NotifyViewModel(this, protectEyesViewModel);
     InitializeComponent();
 }
Beispiel #2
0
        protected override void OnContentRendered(EventArgs e)
        {
            base.OnContentRendered(e);
            var transform = PresentationSource.FromVisual(this).CompositionTarget.TransformFromDevice;
            var corner    = transform.Transform(new System.Windows.Point(Area.Right, Area.Bottom));

            Left = corner.X - ActualWidth;
            Top  = corner.Y - ActualHeight;

            NotifyViewModel.StartCountTime();
        }