private static IDisposable ShowPinWindow(IntPtr hWnd, PinOperations operation) { var vmodel = new NotificationWindowViewModel { Title = ProductInfo.Title, Body = $"{(operation.HasFlag(PinOperations.Window) ? "Window" : "Application")} {(operation.HasFlag(PinOperations.Pin) ? "Pinned" : "Unpinned")}", }; var source = new CancellationTokenSource(); var window = new PinWindow(hWnd) { DataContext = vmodel, }; window.Show(); Task.Delay(TimeSpan.FromMilliseconds(Settings.General.NotificationDuration), source.Token) .ContinueWith(_ => window.Close(), TaskScheduler.FromCurrentSynchronizationContext()); return(Disposable.Create(() => source.Cancel())); }
private static IDisposable ShowPinWindow(IntPtr hWnd, PinOperations operation) { var vmodel = new NotificationWindowViewModel { Title = ProductInfo.Title, Header = ProductInfo.Title, Body = $"{(operation.HasFlag(PinOperations.Pin) ? "Pinned" : "Unpinned")} this {(operation.HasFlag(PinOperations.Window) ? "window" : "application")}", }; var source = new CancellationTokenSource(); var window = new PinNotificationWindow(hWnd) { DataContext = vmodel, }; window.Show(); Task.Delay(TimeSpan.FromMilliseconds(Settings.General.NotificationDuration), source.Token) .ContinueWith(_ => window.Close(), TaskScheduler.FromCurrentSynchronizationContext()); return Disposable.Create(() => source.Cancel()); }
public WindowPinnedEventArgs(IntPtr target, PinOperations operation) { this.Target = target; this.PinOperation = operation; }
private static void RaisePinnedEvent(IntPtr target, PinOperations operation) { WindowPinned?.Invoke(typeof(VirtualDesktopService), new WindowPinnedEventArgs(target, operation)); }
public WindowPinnedEventArgs(IntPtr target, PinOperations operation) { this.Target = target; this.PinOperation = operation; }
private static void RaisePinnedEvent(IntPtr target, PinOperations operation) { WindowPinned?.Invoke(typeof(VirtualDesktopService), new WindowPinnedEventArgs(target, operation)); }