Exemplo n.º 1
0
        //CONSTRUCTOR!!!
        public BaseInfoVM(Page page, NetworkDataHub netDataHub, SystemDataHub sysDataHub) : base(page)
        {
            NetDataHub = netDataHub;
            SysDataHub = sysDataHub;

            ShortNetInfo         = (ShortNetInfoControl)m_Page.FindName(nameof(ShortNetInfo));
            WorkingAdaptersInfo  = (WorkingAdaptersInfoControl)m_Page.FindName(nameof(WorkingAdaptersInfo));
            DisabledAdaptersInfo = (DisabledAdaptersInfoControl)m_Page.FindName(nameof(DisabledAdaptersInfo));
            OtherInfo            = (OtherInfoControl)m_Page.FindName(nameof(OtherInfo));
            MatherboardInfo      = (MatherboardInfoControl)m_Page.FindName(nameof(MatherboardInfo));
            RAMInfo  = (RAMInfoControl)m_Page.FindName(nameof(RAMInfo));
            BIOSInfo = (BIOSInfoControl)m_Page.FindName(nameof(BIOSInfo));
            OSInfo   = (OSInfoControl)m_Page.FindName(nameof(OSInfo));
            CPUInfo  = (CPUInfoControl)m_Page.FindName(nameof(CPUInfo));

            ShortNetInfo.UpdateAnimationCompleted         += ShortNetInfo_UpdateAnimationCompleted;
            WorkingAdaptersInfo.UpdateAnimationCompleted  += WorkingAdaptersInfo_UpdateAnimationCompleted;
            DisabledAdaptersInfo.UpdateAnimationCompleted += DisabledAdaptersInfo_UpdateAnimationCompleted;
            OtherInfo.UpdateAnimationCompleted            += OtherInfo_UpdateAnimationCompleted;
            MatherboardInfo.UpdateAnimationCompleted      += MatherboardInfo_UpdateAnimationCompleted;
            RAMInfo.UpdateAnimationCompleted  += RAMInfo_UpdateAnimationCompleted;
            BIOSInfo.UpdateAnimationCompleted += BIOSInfo_UpdateAnimationCompleted;
            OSInfo.UpdateAnimationCompleted   += OSInfo_UpdateAnimationCompleted;

            UpdateDataTimer.Elapsed += UpdateShortNetInfo;
            UpdateDataTimer.Enabled  = true;

            InitShortNetInfo();
        }
        public NetScanningMainPage(NetworkDataHub dataHub)
        {
            InitializeComponent();

            this.DataContext = new NetScanningVM(this, dataHub);

            this.Loaded += NetScanningMainPage_Loaded;
        }
Exemplo n.º 3
0
        //CONSTRUCTOR!!!
        public NetScanningVM(Page page, NetworkDataHub dataHub) : base(page)
        {
            //Data connect
            DataHub = dataHub;

            //Elements searching
            ContentViewer = (ContentControl)m_Page.FindName(nameof(ContentViewer));

            PrepearScanSettings();
        }
Exemplo n.º 4
0
        //CONSTRUCTOR!!!
        public MainWindowVM(Window window)
        {
            mainWindow = window;

            mainWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            mainWindow.WindowState           = WindowState.Normal;
            mainWindow.Opacity = 0;

            mainWindow.Cursor = CustomCursors.Normal_Select;

            //Init loading window
            loadingWindow = new LoadingWindow();
            loadingWindow.Show();
            loadingWindow.Closed += LoadingWindow_Closed;

            //Models init
            Task.Run(() =>
            {
                BasicNetInterfaceDataHub = new NetworkDataHub(BasicInterfaceTypes.ToArray());
                BasicSystemDataHub       = new SystemDataHub();
            });

            //Searching elements
            mainWindow.ApplyTemplate();
            titleLine         = (Grid)mainWindow.Template.FindName("TitleLine", mainWindow);
            windowNeon        = (DropShadowEffect)mainWindow.Template.FindName("WindowNeon", mainWindow);
            maxSizeButton     = (Button)mainWindow.Template.FindName("MaxSizeButton", mainWindow);
            minSizeButton     = (Button)mainWindow.Template.FindName("MinSizeButton", mainWindow);
            closeWindowButton = (Button)mainWindow.Template.FindName("CloseWindowButton", mainWindow);
            pagesViewer       = (Frame)mainWindow.FindName("PagesViewer");
            sideMenu          = (SideMenuControl)mainWindow.FindName("SideMenu");
            nextPageButton    = (Button)sideMenu.Template.FindName("NextButton", sideMenu);
            prevPageButton    = (Button)sideMenu.Template.FindName("PrevButton", sideMenu);
            homeButton        = (Button)sideMenu.Template.FindName("HomeButton", sideMenu);

            //Menu buttons click events connect
            foreach (Button menuButton in (sideMenu.Content as StackPanel).Children)
            {
                menuButton.Click += ChangeMenuSelection;
            }

            //Navigate buttons init
            nextPageButton.IsEnabled = false;
            prevPageButton.IsEnabled = false;

            //Commands time!
            CommandsInit();

            //Pages array init
            Pages = new Page[3];

            //PagesViewer init
            DoubleAnimation OpenAnim = new DoubleAnimation(1, new Duration(new TimeSpan(0, 0, 0, 0, 750)));

            welcomePage            = new WelcomePage();
            welcomePage.MouseDown += WelcomePage_MouseDown;

            pagesViewer.JournalOwnership = JournalOwnership.OwnsJournal;
            pagesViewer.Content          = welcomePage;
            pagesViewer.Navigated       += PagesViewer_Navigated;
            welcomePage.BeginAnimation(Page.OpacityProperty, OpenAnim);
            WelcomePageON = true;

            //Window events binding
            mainWindow.StateChanged += MainWindow_StateChanged;
            mainWindow.Loaded       += MainWindow_Loaded;
            mainWindow.MouseEnter   += MainWindow_MouseEnter;
            mainWindow.MouseLeave   += MainWindow_MouseLeave;
        }
Exemplo n.º 5
0
 public BaseInfoPage(NetworkDataHub NetDataHub, SystemDataHub SysDataHub)
 {
     InitializeComponent();
     DataContext  = new BaseInfoVM(this, NetDataHub, SysDataHub);
     this.Loaded += NetworkInfoPage_Loaded;
 }