Esempio n. 1
0
 public SettingsPartViewModel(IMyDialogService dlg, IBusyService busy, IAppSettingsService _appSettings, IStorageInterfaceService _storageInterfaceService)
 {
     this.DialogSrv        = dlg;
     this.BusySrv          = busy;
     this._settings        = _appSettings;
     this.StorageInterface = _storageInterfaceService;
 }
Esempio n. 2
0
 /// <summary>Constructrs the <see cref="DriveSelectViewModel"/>.</summary>
 public ConfigureViewModel(SettingsService settings,
                           UIService ui,
                           IMyDialogService dialog)
 {
     Settings = settings;
     UI       = ui;
     Dialogs  = dialog;
 }
 /// <summary>Constructrs the <see cref="DriveSelectViewModel"/>.</summary>
 public ConfigureViewModel(SettingsService settings,
                           UIService ui,
                           IMyDialogService dialog,
                           RelayCommandFactory relayFactory)
     : base(relayFactory)
 {
     Settings = settings;
     UI       = ui;
     Dialogs  = dialog;
 }
Esempio n. 4
0
        public MainPageViewModel(IMyDialogService dlg, IBusyService busy)
        {
            if (Windows.ApplicationModel.DesignMode.DesignModeEnabled)
            {
                Value = "Designtime value";
            }

            this.DialogSrv = dlg;
            this.BusySrv   = busy;
        }
Esempio n. 5
0
        #pragma warning restore 67

        public MainViewModel(IMyDialogService dlg, IBusyService busy, IAppSettingsService settings)
        {
            this.DialogSrv   = dlg;
            this.BusySrv     = busy;
            this.settingsSrv = settings;

            AvailableTransportTypes = EnumHelper.ListOf <TransportType>();
            AvailableDevices        = new ObservableCollection <NanoDeviceBase>();

            SelectedDevice = null;
            SelectedDeviceConnectionResult = PingConnectionResult.None;
            IsBusyHeader = false;
        }
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(SettingsService settings,
                             ScanningService scanning,
                             IconCacheService iconCache,
                             UIService ui,
                             BitmapFactory bitmapFactory,
                             ImagesServiceBase images,
                             ClipboardService clipboard,
                             OSService os,
                             IMyDialogService dialogs,
                             TreemapRendererFactory treemapFactory,
                             RelayCommandFactory relayFactory)
            : base(relayFactory)
        {
            Settings      = settings;
            Scanning      = scanning;
            IconCache     = iconCache;
            UI            = ui;
            BitmapFactory = bitmapFactory;
            Images        = images;
            Clipboard     = clipboard;
            OS            = os;
            Dialogs       = dialogs;
            Treemap       = treemapFactory.Create();

            Settings.PropertyChanged += OnSettingsPropertyChanged;
            Scanning.PropertyChanged += OnScanningPropertyChanged;

            Extensions = new ExtensionItemViewModelCollection(this);

            SelectedFiles = new ObservableCollection <FileItemViewModel>();
            SelectedFiles.CollectionChanged += OnSelectedFilesChanged;

            FileComparer      = new FileComparer();
            ExtensionComparer = new ExtensionComparer();
            UpdateEmptyRecycleBin();

            GCRAMUsage = GC.GetTotalMemory(false);
            if (IsInDesignMode)
            {
                // Code runs in Blend --> create design time data.
            }
            else
            {
                // Code runs "for real"
                ramTimer    = UI.StartTimer(Settings.RAMInterval, true, OnRAMUsageTick);
                statusTimer = UI.CreateTimer(Settings.StatusInterval, true, OnStatusTick);
            }
        }
        /// <summary>Constructrs the <see cref="DriveSelectViewModel"/>.</summary>
        public DriveSelectViewModel(SettingsService settings,
                                    UIService ui,
                                    IMyDialogService dialog,
                                    IconCacheService iconCache,
                                    ScanningService scanning)
        {
            Settings  = settings;
            UI        = ui;
            Dialogs   = dialog;
            IconCache = iconCache;
            Scanning  = scanning;

            Drives        = new DriveItemViewModelCollection(this);
            DriveComparer = new DriveComparer();

            SelectedDrives = new ObservableCollection <DriveItemViewModel>();
            SelectedDrives.CollectionChanged += OnSelectedDrivesChanged;
        }
Esempio n. 8
0
 public SettingsPageViewModel(IMyDialogService dlg, IBusyService busy, IAppSettingsService _appSettings, IStorageInterfaceService _storageInterfaceService)
 {
     SettingsPartViewModel = new SettingsPartViewModel(dlg, busy, _appSettings, _storageInterfaceService);
     AboutPartViewModel    = new AboutPartViewModel(dlg, busy);
 }
Esempio n. 9
0
 public AboutPartViewModel(IMyDialogService dlg, IBusyService busy)
 {
     this.DialogSrv = dlg;
     this.BusySrv   = busy;
 }
Esempio n. 10
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(IMyDialogService myDialogService)
        {
            dialogService = myDialogService;

            //TreeNodes = new ObservableCollection<TreeNodeInfo>
            //{
            //    new TreeNodeInfo
            //    {
            //        Name="WPF UI",
            //        IconKind=PackIconKind.Folder,
            //        Foreground = new SolidColorBrush(Color.FromRgb(0xf9,0xa8,0x25)),
            //        Content="folder",
            //        Remarks="",
            //        Childs=new ObservableCollection<TreeNodeInfo>
            //        {
            //            new TreeNodeInfo
            //            {
            //                Name="Material Design",
            //                IconKind=PackIconKind.Code,
            //                Foreground = new SolidColorBrush(Color.FromRgb(0x02,0x88,0xd1)),
            //                Content=" <ResourceDictionary.MergedDictionaries>"+
            //                        "<ResourceDictionary Source='pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml'/>"+
            //                        "<ResourceDictionary Source='pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml'/>"+
            //                        "<ResourceDictionary Source='pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.indigo.xaml'/>"+
            //                        "<ResourceDictionary Source='pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.pink.xaml'/>"+
            //                        "<ResourceDictionary Source='pack://application:,,,/Dragablz;component/Themes/materialdesign.xaml' />"+
            //                        "</ResourceDictionary.MergedDictionaries>",
            //                Remarks="备注"
            //            }
            //        }
            //    },
            //    new TreeNodeInfo
            //    {
            //        Name="Common",
            //        IconKind=PackIconKind.Folder,
            //        Foreground = new SolidColorBrush(Color.FromRgb(0xf9,0xa8,0x25)),
            //        Content="Common",
            //        Remarks="",
            //        Childs=new ObservableCollection<TreeNodeInfo>
            //        {
            //        }
            //    },
            //    new TreeNodeInfo
            //    {
            //        Name="Winform",
            //        IconKind=PackIconKind.Folder,
            //        Foreground = new SolidColorBrush(Color.FromRgb(0xf9,0xa8,0x25)),
            //        Content="winform",
            //        Remarks="",
            //        Childs=new ObservableCollection<TreeNodeInfo>
            //        {
            //        }
            //    }
            //};
            TreeNodes    = new ObservableCollection <TreeNodeInfo>();
            CurrentNodes = new ObservableCollection <TreeNodeInfo>();

            TreeNodes.Add(new TreeNodeInfo      //添加根文件夹
            {
                Name       = "code",
                IconKind   = PackIconKind.MicrosoftVisualStudio,
                Foreground = new SolidColorBrush(Color.FromRgb(0x39, 0x49, 0xab)),
                Content    = "folder",
                Remarks    = "",
                Childs     = new ObservableCollection <TreeNodeInfo>(),
                FilePath   = codeFolder
            });
            LoadTreeNodes(codeFolder, TreeNodes[0].Childs);

            //CurrentNodes = new ObservableCollection<TreeNodeInfo>(TreeNodes);

            //if (!IsInDesignModeStatic)
            //{
            //    App.Current.MainWindow.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;
            //    App.Current.MainWindow.MaxWidth = SystemParameters.MaximizedPrimaryScreenWidth;
            //}


            MaxVisibility     = Visibility.Visible;
            RestoreVisibility = Visibility.Collapsed;
        }
Esempio n. 11
0
 public ConfigUSBViewModel(IMyDialogService dlg, IBusyService busy)
 {
     this.DialogSrv = dlg;
     this.BusySrv   = busy;
 }
Esempio n. 12
0
 public DeployViewModel(IMyDialogService dlg, IBusyService busy, IStorageInterfaceService _storageInterfaceService)
 {
     this.DialogSrv   = dlg;
     this.BusySrv     = busy;
     StorageInterface = _storageInterfaceService;
 }
Esempio n. 13
0
 public DeviceCapabilitiesViewModel(IMyDialogService dlg, IBusyService busy)
 {
     this.DialogSrv = dlg;
     this.BusySrv   = busy;
 }