Beispiel #1
0
 public ExplorerViewModel(ILifetimeScope scope)
 {
     _scope       = scope ?? throw new ArgumentNullException(nameof(scope));
     Origin       = GetDefaultPath();
     CloseCommand = new RelayUICommand(Close);
     TestCommand  = new RelayUICommand(Test);
 }
Beispiel #2
0
 public TimeSpanBox()
 {
     SideButtonCommand = new RelayUICommand(() =>
     {
         Value = null;
         if (IsEditMode)
         {
             EditableText = string.Empty;
         }
     });
 }
        public BusyContainerAdvancedViewModel()
        {
            ResetContentCommand = new RelayUICommand(() => Content = null, () => Content != null)
            {
                Title = "Reset"
            };

            ContentControlCommands = new[]
            {
                ResetContentCommand,
                new RelayUICommand(() => Content = new CustomState())
                {
                    Title = "Mutable title"
                },
                new RelayUICommand(() => Content = new StateWithMutableDescription())
                {
                    Title = "Mutable description"
                },
                new RelayUICommand(() => Content = new StateWithToStringOverride())
                {
                    Title = "ToString override"
                },
                new RelayUICommand(() => Content = new BusyState
                {
                    Title       = "Built in type",
                    Description = "Some description"
                })
                {
                    Title = "Built in"
                }
            };

            SetContentStateWithMutableTitleCommand = new RelayUICommand(() => Content = new CustomState())
            {
                Title = "Mutable title"
            };
            SetContentStateWithMutableDescriptionCommand = new RelayUICommand(() => Content = new StateWithMutableDescription())
            {
                Title = "Mutable description"
            };
            SetContentStateWithToStringOverrideCommand = new RelayUICommand(() => Content = new StateWithToStringOverride())
            {
                Title = "ToString override"
            };
            SetContentBuiltInBusyStateCommand = new RelayUICommand(() => Content = new BusyState
            {
                Title       = "Built in type",
                Description = "Some description"
            })
            {
                Title = "Built in"
            };
        }
 public RibbonViewModel()
 {
     SomeCommand = new RelayUICommand();
 }