AboutWindow()
        {
            InitializeComponent();
            System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(this);

            Icon = AssemblyRoutines.GetAppIconImageSource();

            ContentRendered += delegate
            {
                //this.MinHeight = this.ActualHeight;
                //this.MaxHeight = this.ActualHeight;
                //this.MinWidth = this.ActualWidth;

                //FormattedText formattedText = new FormattedText(AssemblyProduct, System.Globalization.CultureInfo.CurrentCulture, FlowDirection.LeftToRight);
                //var pagePadding = text.Document.PagePadding;
                //var borderThickness = text.BorderThickness;
                //text.Width = formattedText.Width
                //    + pagePadding.Left + pagePadding.Right
                //    + borderThickness.Left + borderThickness.Right;
            };

            WpfRoutines.AddFadeEffect(this, 300);

            Title = "Cistera Screen Capture";
            try
            {
                set(new AssemblyRoutines.AssemblyInfo(Log.AppDir + "\\CisteraScreenCaptureService.exe"));
            }
            catch (Exception e)
            {
                Message.Error(e);
            }
            TextRange tr = new TextRange(text.Document.ContentEnd, text.Document.ContentEnd);

            tr.Text = "\r\n\r\n";
            set(new AssemblyRoutines.AssemblyInfo());

            WindowStartupLocation = WindowStartupLocation.CenterScreen;

            //WindowStartupLocation = WindowStartupLocation.CenterScreen;
            //DefaultServerIp.ValueDataType = typeof(IPAddress);
        }
        SettingsWindow()
        {
            InitializeComponent();
            System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(this);

            Icon = AssemblyRoutines.GetAppIconImageSource();

            ContentRendered += delegate
            {
                //this.MinHeight = this.ActualHeight;
                //this.MaxHeight = this.ActualHeight;
                //this.MinWidth = this.ActualWidth;
            };

            WpfRoutines.AddFadeEffect(this, 300);

            WindowStartupLocation = WindowStartupLocation.CenterScreen;

            //WindowStartupLocation = WindowStartupLocation.CenterScreen;
            //DefaultServerIp.ValueDataType = typeof(IPAddress);

            general = UiApiClient.GetServiceSettings();
            if (general == null)
            {
                ok.IsEnabled    = false;
                reset.IsEnabled = false;
                Message.Error("The service is unavailable.");
                return;
            }
            set();

            if (!ProcessRoutines.ProcessHasElevatedPrivileges() && !ProcessRoutines.ProcessIsSystem() /*used for configuration during installing*/)
            {
                ok.IsEnabled    = false;
                reset.IsEnabled = false;
                if (Message.YesNo("Settings modification requires elevated privileges. Would you like to restart this application 'As Administrator'?"))
                {
                    ProcessRoutines.Restart(true);
                }
            }
        }