Esempio n. 1
0
        private void InitializeComponents()
        {
            this.Height = SystemMetrics.ScreenHeight;
            this.Width  = SystemMetrics.ScreenWidth;

            Text textChannel = new Text();

            textChannel.Font                = Resources.GetFont(Resources.FontResources.Consolas24);
            textChannel.TextContent         = Resources.GetString(Resources.StringResources.Channel);
            textChannel.HorizontalAlignment = Microsoft.SPOT.Presentation.HorizontalAlignment.Center;
            textChannel.VerticalAlignment   = Microsoft.SPOT.Presentation.VerticalAlignment.Top;

            Text textVolume = new Text();

            textVolume.Font                = Resources.GetFont(Resources.FontResources.Consolas24);
            textVolume.TextContent         = Resources.GetString(Resources.StringResources.Volume);
            textVolume.HorizontalAlignment = Microsoft.SPOT.Presentation.HorizontalAlignment.Center;
            textVolume.VerticalAlignment   = Microsoft.SPOT.Presentation.VerticalAlignment.Bottom;
            textVolume.SetMargin(0, 50, 0, 0);

            channelLabel                     = new Text();
            channelLabel.Font                = Resources.GetFont(Resources.FontResources.Consolas48);
            channelLabel.TextContent         = channel.ToString();
            channelLabel.HorizontalAlignment = Microsoft.SPOT.Presentation.HorizontalAlignment.Center;
            channelLabel.VerticalAlignment   = Microsoft.SPOT.Presentation.VerticalAlignment.Top;

            volumeBar = new VolumeBar();
            volumeBar.HorizontalAlignment = HorizontalAlignment.Center;
            volumeBar.VerticalAlignment   = VerticalAlignment.Bottom;
            volumeBar.Value = 10;

            StackPanel panel = new StackPanel(Orientation.Vertical);

            panel.HorizontalAlignment = HorizontalAlignment.Center;
            panel.VerticalAlignment   = VerticalAlignment.Stretch;
            panel.Children.Add(textChannel);
            panel.Children.Add(channelLabel);
            panel.Children.Add(textVolume);
            panel.Children.Add(volumeBar);

            // Add the text control to the window.
            this.Child = panel;

            // Set the window visibility to visible.
            this.Visibility = Visibility.Visible;

            // Attach the button focus to the window.
            Buttons.Focus(this);
        }
Esempio n. 2
0
        private void InitializeComponents()
        {
            this.Height = SystemMetrics.ScreenHeight;
            this.Width = SystemMetrics.ScreenWidth;

            Text textChannel = new Text();
            textChannel.Font = Resources.GetFont(Resources.FontResources.Consolas24);
            textChannel.TextContent = Resources.GetString(Resources.StringResources.Channel);
            textChannel.HorizontalAlignment = Microsoft.SPOT.Presentation.HorizontalAlignment.Center;
            textChannel.VerticalAlignment = Microsoft.SPOT.Presentation.VerticalAlignment.Top;

            Text textVolume = new Text();
            textVolume.Font = Resources.GetFont(Resources.FontResources.Consolas24);
            textVolume.TextContent = Resources.GetString(Resources.StringResources.Volume);
            textVolume.HorizontalAlignment = Microsoft.SPOT.Presentation.HorizontalAlignment.Center;
            textVolume.VerticalAlignment = Microsoft.SPOT.Presentation.VerticalAlignment.Bottom;
            textVolume.SetMargin(0, 50, 0, 0);

            channelLabel = new Text();
            channelLabel.Font = Resources.GetFont(Resources.FontResources.Consolas48);
            channelLabel.TextContent = channel.ToString();
            channelLabel.HorizontalAlignment = Microsoft.SPOT.Presentation.HorizontalAlignment.Center;
            channelLabel.VerticalAlignment = Microsoft.SPOT.Presentation.VerticalAlignment.Top;

            volumeBar = new VolumeBar();
            volumeBar.HorizontalAlignment = HorizontalAlignment.Center;
            volumeBar.VerticalAlignment = VerticalAlignment.Bottom;
            volumeBar.Value = 10;

            StackPanel panel = new StackPanel(Orientation.Vertical);
            panel.HorizontalAlignment = HorizontalAlignment.Center;
            panel.VerticalAlignment = VerticalAlignment.Stretch;
            panel.Children.Add(textChannel);
            panel.Children.Add(channelLabel);
            panel.Children.Add(textVolume);
            panel.Children.Add(volumeBar);

            // Add the text control to the window.
            this.Child = panel;

            // Set the window visibility to visible.
            this.Visibility = Visibility.Visible;

            // Attach the button focus to the window.
            Buttons.Focus(this);
        }