Пример #1
0
        public CoverControl(Entity entity)
        {
            this.InitializeComponent();

            this.RequestedTheme = ThemeControl.GetApplicationTheme();

            Entity = entity;

            InitializeUI();
        }
Пример #2
0
        public MediaControl(Entity entity)
        {
            this.InitializeComponent();

            this.RequestedTheme = ThemeControl.GetApplicationTheme();

            PanelEntity = entity;

            UpdateUI();
        }
Пример #3
0
        public WebLinkControl(Entity entity, double width, double height)
        {
            this.InitializeComponent();

            this.RequestedTheme = ThemeControl.GetApplicationTheme();

            if (this.FindName("RootWebView") is WebView webView)
            {
                webView.Width  = width - 30;
                webView.Height = height - 30;
                webView.Navigate(new Uri(entity.State));
            }
        }
Пример #4
0
        public LightControl(Entity entity, IEnumerable <Entity> childrenEntities)
        {
            this.InitializeComponent();

            this.RequestedTheme = ThemeControl.GetApplicationTheme();

            PanelEntity      = entity;
            ChildrenEntities = childrenEntities;

            DrawColorWheel();

            InitializeUI();
        }
Пример #5
0
        public SettingsControl()
        {
            this.InitializeComponent();

            this.RequestedTheme = ThemeControl.GetApplicationTheme();

            if (null != HttpProtocol)
            {
                TextBox homeAssistantProtocol = this.FindName("HomeAssistantProtocolText") as TextBox;
                homeAssistantProtocol.Text = HttpProtocol;
            }
            if (null != HomeAssistantHostname)
            {
                TextBox homeAssistantHostname = this.FindName("HomeAssistantHostnameText") as TextBox;
                homeAssistantHostname.Text = HomeAssistantHostname;
            }
            if (null != HomeAssistantPort)
            {
                TextBox homeAssistantPort = this.FindName("HomeAssistantPortText") as TextBox;
                homeAssistantPort.Text = HomeAssistantPort;
            }
            if (null != HomeAssistantPassword)
            {
                PasswordBox homeAssistantPassword = this.FindName("HomeAssistantPasswordText") as PasswordBox;
                homeAssistantPassword.Password = HomeAssistantPassword;
            }
            if (null != MqttBrokerHostname)
            {
                TextBox mqttBrokerHostname = this.FindName("MqttBrokerHostnameText") as TextBox;
                mqttBrokerHostname.Text = MqttBrokerHostname;
            }
            if (null != MqttUsername)
            {
                TextBox mqttUsername = this.FindName("MqttUsernameText") as TextBox;
                mqttUsername.Text = MqttUsername;
            }
            if (null != MqttPassword)
            {
                PasswordBox mqttPassword = this.FindName("MqttPasswordText") as PasswordBox;
                mqttPassword.Password = MqttPassword;
            }
            if (null != MqttTopic)
            {
                TextBox mqttStateStream = this.FindName("MqttStateStreamText") as TextBox;
                mqttStateStream.Text = MqttTopic;
            }
        }