public static void Create()
        {
            var clear = new Subject <Unit>();

            Application.Desktop.CreateSingletonWindow(
                Observable.Return(true),
                dialog => new Window
            {
                Title   = Observable.Return("Console output"),
                Size    = Property.Create <Optional <Size <Points> > >(new Size <Points>(600, 600)).ToOptional(),
                Content = LogView.Create(InitializeConsoleRedirection(), color: Theme.DefaultText, clear: clear, darkTheme: Theme.IsDark)
                          .WithBackground(Theme.PanelBackground)
                          .WithOverlay(ThemedButton.Create(Command.Enabled(() => clear.OnNext(Unit.Default)), "Clear").DockTopRight()),
                Background = Theme.PanelBackground,
                Foreground = Theme.DefaultText,
                Border     = Separator.MediumStroke
            });
        }
示例#2
0
 static IControl CreateButton(
     Command command,
     Brush hoverColor     = default(Brush),
     Command mouseEntered = default(Command),
     Command mouseExited  = default(Command))
 {
     return
         (Layout.StackFromTop(
              ThemedButton.Create(
                  command: command,
                  label: "Make class from selection",
                  icon: Icons.ExtractClass(command.IsEnabled),
                  tooltip: "Make class from selection",
                  hoverColor: hoverColor)
              .WithHeight(45)
              .OnMouse(
                  entered: mouseEntered,
                  exited: mouseExited),
              Separator.Shadow));
 }