ApplyThemeTo() public static method

Will recursively apply the current theme to 'control'
public static ApplyThemeTo ( Control control ) : void
control System.Windows.Forms.Control
return void
Example #1
0
        public static Form ShowXamarinControl(this ContentPage ctl, int Width, int Height)
        {
            var f = new Xamarin.Forms.Platform.WinForms.PlatformRenderer();

            Xamarin.Forms.Platform.WinForms.Forms.Init(f);

            f.Width  = Width;
            f.Height = Height;
            var app = new Xamarin.Forms.Application()
            {
                MainPage = ctl
            };

            f.LoadApplication(app);
            ThemeManager.ApplyThemeTo(f);
            if (ctl is IClose)
            {
                ((IClose)ctl).CloseAction = () => f.Close();
            }

            f.ShowDialog();

            return(f);
        }
Example #2
0
        public static void DoUpdate()
        {
            if (Program.WindowsStoreApp)
            {
                CustomMessageBox.Show(Strings.Not_available_when_used_as_a_windows_store_app);
                return;
            }

            IProgressReporterDialogue frmProgressReporter = new ProgressReporterDialogue()
            {
                Text          = "Check for Updates",
                StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
            };

            ThemeManager.ApplyThemeTo(frmProgressReporter);

            frmProgressReporter.DoWork += new DoWorkEventHandler(DoUpdateWorker_DoWork);

            frmProgressReporter.UpdateProgressAndStatus(-1, "Checking for Updates");

            frmProgressReporter.RunBackgroundOperationAsync();

            frmProgressReporter.Dispose();
        }