Пример #1
0
        private void _BuildAppStatusBar()
        {
            if (m_AppStatusBar == null)
            {
                return;
            }

            //FIX...
            m_AppStatusBar.Margin = new Thickness(0, 2, -2, 0);

            m_AppStatusBar.Background = new SolidColorBrush(m_Theme.ThemeColors.AppStatusBack);

            ColumnDefinition cd;

            cd = new ColumnDefinition(); cd.Width = GridLength.Auto; m_AppStatusBar.ColumnDefinitions.Add(cd);
            cd = new ColumnDefinition(); cd.Width = new GridLength(2, GridUnitType.Pixel); m_AppStatusBar.ColumnDefinitions.Add(cd);
            cd = new ColumnDefinition(); cd.Width = GridLength.Auto; m_AppStatusBar.ColumnDefinitions.Add(cd);
            cd = new ColumnDefinition(); cd.Width = new GridLength(1, GridUnitType.Star); m_AppStatusBar.ColumnDefinitions.Add(cd);
            cd = new ColumnDefinition(); cd.Width = GridLength.Auto; m_AppStatusBar.ColumnDefinitions.Add(cd);

            m_txtSysInf            = new TextBoxDenieEdit(true, true, m_AppStatusBar, Grid.ColumnProperty, 0);
            m_txtSysInf.Background = new SolidColorBrush(m_Theme.ThemeColors.AppStatusBack);
            m_txtSysInf.Foreground = new SolidColorBrush(m_Theme.ThemeColors.AppStatusFore);
            m_txtSysInf.FontSize   = 16;
            m_txtSysInf.Text       = _GetAppMemInfo();

            Rectangle rcDiv;

            rcDiv      = new Rectangle();
            rcDiv.Fill = new SolidColorBrush(Colors.Black);
            rcDiv.SetValue(Grid.ColumnProperty, 1);
            m_AppStatusBar.Children.Add(rcDiv);

            m_txtTRACE            = new TextBoxDenieEdit(true, true, m_AppStatusBar, Grid.ColumnProperty, 2);
            m_txtTRACE.Visibility = Rsc.Collapsed;
            m_txtTRACE.Background = new SolidColorBrush(Colors.Brown);
            m_txtTRACE.Foreground = new SolidColorBrush(Colors.Yellow);
            m_txtTRACE.FontSize   = 16;
            m_txtTRACE.Text       = "";

            m_txtStatus            = new TextBoxDenieEdit(true, true, m_AppStatusBar, Grid.ColumnProperty, 3);
            m_txtStatus.Background = new SolidColorBrush(m_Theme.ThemeColors.AppStatusBack);
            m_txtStatus.Foreground = new SolidColorBrush(m_Theme.ThemeColors.AppStatusFore);
            m_txtStatus.FontSize   = 16;
            m_txtStatus.Text       = csStatusDefault;

            m_btnNext = new RscIconButton(m_AppStatusBar, Grid.ColumnProperty, 4, 36, 36, Rsc.Visible);
            m_btnNext.Image.Source = m_Theme.GetImage("Images/Btn001_Next.jpg");
            m_btnNext.Click       += new System.Windows.RoutedEventHandler(btnNext_Click);
        }
Пример #2
0
        protected void _BuildAppTitleBar()
        {
            if (m_AppTitleBar == null)
            {
                return;
            }

            //m_AppTitleBar.Margin = new Thickness(0, 0, 0, 4);
            m_AppTitleBar.Background = new SolidColorBrush(m_Theme.ThemeColors.AppTitleBack);

            ColumnDefinition cd;

            cd = new ColumnDefinition(); cd.Width = GridLength.Auto; m_AppTitleBar.ColumnDefinitions.Add(cd);
            cd = new ColumnDefinition(); cd.Width = GridLength.Auto; m_AppTitleBar.ColumnDefinitions.Add(cd);
            cd = new ColumnDefinition(); cd.Width = GridLength.Auto; m_AppTitleBar.ColumnDefinitions.Add(cd);
            cd = new ColumnDefinition(); cd.Width = new GridLength(1, GridUnitType.Star); m_AppTitleBar.ColumnDefinitions.Add(cd);
            cd = new ColumnDefinition(); cd.Width = GridLength.Auto; m_AppTitleBar.ColumnDefinitions.Add(cd);

            m_imgAppIcon = new RscIcon(m_AppTitleBar, Grid.ColumnProperty, 0, 36, 36, Rsc.Visible);
            m_imgAppIcon.Image.Source = m_Theme.GetImage(m_sAppIconRes);

            m_btnNoSleep = new RscIconButton(m_AppTitleBar, Grid.ColumnProperty, 1, 36, 36, Rsc.Collapsed);
            m_btnNoSleep.Image.Source = m_Theme.GetImage("Images/IcoSm001_ScreenSaver.jpg");
            m_btnNoSleep.Click       += new System.Windows.RoutedEventHandler(btnNoSleep_Click);

            m_btnTools = new RscIconButton(m_AppTitleBar, Grid.ColumnProperty, 2, 36, 36, Rsc.Collapsed);
            m_btnTools.Image.Source = m_Theme.GetImage("Images/IcoSm001_LauncherMini.jpg");
            m_btnTools.Click       += new System.Windows.RoutedEventHandler(m_btnTools_Click);

            m_tbTitle               = new TextBlock();
            m_tbTitle.Text          = AppTitle;
            m_tbTitle.Foreground    = new SolidColorBrush(m_Theme.ThemeColors.AppTitleFore);
            m_tbTitle.Margin        = new Thickness(5);
            m_tbTitle.TextAlignment = TextAlignment.Center;
            m_tbTitle.SetValue(Grid.ColumnProperty, 3);
            m_AppTitleBar.Children.Add(m_tbTitle);

            RscIconButton btnClose = new RscIconButton(m_AppTitleBar, Grid.ColumnProperty, 4, 36, 36, Rsc.Visible);

            btnClose.Image.Source = m_Theme.GetImage("Images/Btn001_Close.jpg");
            btnClose.Click       += new System.Windows.RoutedEventHandler(btnClose_Click);
        }
Пример #3
0
        public void StartTimer(string sReason, Grid LayoutRoot, int iGridRow, int iMax, bool bCanCancel = false, int iPosStart = 0)
        {
            m_iTmrMax    = iMax;
            m_iTmrPos    = iPosStart;
            m_sTmrReason = sReason;

            m_bTmrCanCancel = bCanCancel;
            m_bTmrCancel    = false;

            //BUG: Unable to press cancel...
            //this.m_AppPage.IsEnabled = false;
            m_aRcTmr = new List <Rectangle>();
            int iRd = -1;

            foreach (RowDefinition rdTmp in LayoutRoot.RowDefinitions)
            {
                iRd++;

                Rectangle rc = new Rectangle();
                rc.Fill    = new SolidColorBrush(Colors.Red);
                rc.Opacity = 0.1;
                rc.SetValue(Grid.RowProperty, iRd);
                LayoutRoot.Children.Add(rc);

                m_aRcTmr.Add(rc);
            }

            m_cnvTmr        = new Canvas();
            m_cnvTmr.Width  = 100;
            m_cnvTmr.Height = 100;
            m_cnvTmr.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
            m_cnvTmr.VerticalAlignment   = System.Windows.VerticalAlignment.Center;
            //m_cnvTmr.Background = new SolidColorBrush(Colors.Red);
            m_cnvTmr.SetValue(Grid.RowProperty, iGridRow);

            m_grdLayoutRootTmr = LayoutRoot;
            m_grdLayoutRootTmr.Children.Add(m_cnvTmr);

            Grid grd = new Grid();

            grd.Width      = 100;
            grd.Height     = 100;
            grd.Background = new SolidColorBrush(Colors.White);
            RowDefinition rd;

            rd = new RowDefinition(); grd.RowDefinitions.Add(rd);
            rd = new RowDefinition(); rd.Height = GridLength.Auto; grd.RowDefinitions.Add(rd);
            m_cnvTmr.Children.Add(grd);

            Image img = new Image();

            //img.Width = 100;
            //img.Height = 100;
            img.Source = m_isTmrWc;
            img.SetValue(Grid.RowProperty, 0);
            grd.Children.Add(img);

            if (bCanCancel)
            {
                Image imgTmrCancel = new Image();
                imgTmrCancel.Width  = 36;
                imgTmrCancel.Height = 36;
                imgTmrCancel.Margin = new Thickness(64 + 2, -48 + 2, 2, 2);
                imgTmrCancel.Source = m_Theme.GetImage("Images/Btn001_Close.jpg");
                imgTmrCancel.SetValue(Grid.RowProperty, 0);
                grd.Children.Add(imgTmrCancel);

                //RscIconButton btnTmrCancel = new RscIconButton(grd, Grid.RowProperty, 0, 36, 36, Rsc.Visible, 64, -48);
                RscIconButton btnTmrCancel = new RscIconButton(grd, Grid.RowProperty, 0, 90, 90, Rsc.Visible);
                btnTmrCancel.IsEnabled = true;
                //btnTmrCancel.Image.Source = m_DefaultedImageList.GetImage("Images/Btn001_Close.jpg");
                btnTmrCancel.Click += new System.Windows.RoutedEventHandler(btnTmrCancel_Click);
            }

            m_prsTmr        = new ProgressBar();
            m_prsTmr.Height = 10;
            m_prsTmr.Margin = new Thickness(-12, 0, -12, 6);
            m_prsTmr.RenderTransformOrigin = new Point(0.5, 0.5);
            CompositeTransform ct = new CompositeTransform();

            ct.ScaleY = -2;
            m_prsTmr.RenderTransform = ct;
            m_prsTmr.Minimum         = 0;
            m_prsTmr.Maximum         = iMax;
            m_prsTmr.Value           = iPosStart;
            m_prsTmr.Width           = 100;
            m_prsTmr.SetValue(Grid.RowProperty, 1);
            grd.Children.Add(m_prsTmr);

            //m_tmrApp.Interval = new TimeSpan(1000);
            m_tmrApp.Start();
        }