</Style>
</StackPanel.Resources>
- <Button Command="{Binding Path=SwitchToLoginPage}" Background="LightGreen" x:Name="btnLogin" Content="Login"/>
- <Button Command="{Binding Path=SwitchToStatusPage}" Background="LightGray" Click="button_click" x:Name="btnStatus" Content="Status"/>
- <Button Command="{Binding Path=SwitchToOverviewPage}" IsEnabled="{Binding Path=ButtonOverviewPageIsActive}" Background="LightGray" x:Name="btnOverview" Content="Overview"/>
- <Button Command="{Binding Path=SwitchToDSLPage}" IsEnabled="{Binding Path=ButtonDSLPageIsActive}" Background="LightGray" x:Name="btnDsl" Content="DSL"/>
- <Button Command="{Binding Path=SwitchToLteInfoPage}" IsEnabled="{Binding Path=ButtonLteInfoPageIsActive}" Background="LightGray" x:Name="btnLteInfo" Content="LteInfo"/>
- <Button Command="{Binding Path=SwitchToSyslogPage}" IsEnabled="{Binding Path=ButtonSyslogPageIsActive}" Background="LightGray" x:Name="btnSyslog" Content="Syslog"/>
- <Button Command="{Binding Path=SwitchToTR181Page}" IsEnabled="{Binding Path=ButtonTR181PageIsActive}" Background="LightGray" x:Name="btnTR181" Content="TR-181"/>
- <Button Command="{Binding Path=SwitchToPhonePage}" IsEnabled="{Binding Path=ButtonPhonePageIsActive}" Background="LightGray" x:Name="btnPhone" Content="Anrufe"/>
- <Button Command="{Binding Path=SwitchToLanPage}" IsEnabled="{Binding Path=ButtonLanPageIsActive}" Background="LightGray" x:Name="btnLan" Content="Lan"/>
- <Button Command="{Binding Path=SwitchToControlsPage}" IsEnabled="{Binding Path=ButtonControlsPageIsActive}" Background="LightGray" x:Name="btnControls" Content="Controls"/>
+ <Button Command="{Binding Path=SwitchToLoginPage}" Background="{Binding Path=ButtonLoginPageBackground}" x:Name="btnLogin" Content="Login"/>
+ <Button Command="{Binding Path=SwitchToStatusPage}" Background="{Binding Path=ButtonStatusPageBackground}" Click="button_click" x:Name="btnStatus" Content="Status"/>
+ <Button Command="{Binding Path=SwitchToOverviewPage}" IsEnabled="{Binding Path=ButtonOverviewPageIsActive}" Background="{Binding Path=ButtonOverviewPageBackground}" x:Name="btnOverview" Content="Overview"/>
+ <Button Command="{Binding Path=SwitchToDSLPage}" IsEnabled="{Binding Path=ButtonDSLPageIsActive}" Background="{Binding Path=ButtonDSLPageBackground}" x:Name="btnDsl" Content="DSL"/>
+ <Button Command="{Binding Path=SwitchToLteInfoPage}" IsEnabled="{Binding Path=ButtonLteInfoPageIsActive}" Background="{Binding Path=ButtonLteInfoPageBackground}" x:Name="btnLteInfo" Content="LteInfo"/>
+ <Button Command="{Binding Path=SwitchToSyslogPage}" IsEnabled="{Binding Path=ButtonSyslogPageIsActive}" Background="{Binding Path=ButtonSyslogPageBackground}" x:Name="btnSyslog" Content="Syslog"/>
+ <Button Command="{Binding Path=SwitchToTR181Page}" IsEnabled="{Binding Path=ButtonTR181PageIsActive}" Background="{Binding Path=ButtonTR181PageBackground}" x:Name="btnTR181" Content="TR-181"/>
+ <Button Command="{Binding Path=SwitchToPhonePage}" IsEnabled="{Binding Path=ButtonPhonePageIsActive}" Background="{Binding Path=ButtonPhonePageBackground}" x:Name="btnPhone" Content="Anrufe"/>
+ <Button Command="{Binding Path=SwitchToLanPage}" IsEnabled="{Binding Path=ButtonLanPageIsActive}" Background="{Binding Path=ButtonLanPageBackground}" x:Name="btnLan" Content="Lan"/>
+ <Button Command="{Binding Path=SwitchToControlsPage}" IsEnabled="{Binding Path=ButtonControlsPageIsActive}" Background="{Binding Path=ButtonControlsPageBackground}" x:Name="btnControls" Content="Controls"/>
</StackPanel>
- <Button Command="{Binding Path=SwitchToAboutPage}" IsEnabled="True" Background="LightGray" x:Name="btnAbout" Content="Über" VerticalAlignment="Top" HorizontalAlignment="Right" Width="32" Margin="0,0,3,0"/>
+ <Button Command="{Binding Path=SwitchToAboutPage}" Background="{Binding Path=ButtonAboutPageBackground}" x:Name="btnAbout" Content="Über" VerticalAlignment="Top" HorizontalAlignment="Right" Width="32" Margin="0,0,3,0"/>
<DockPanel Margin="0,22,0,0">
<Frame x:Name="frame" NavigationUIVisibility="Hidden" Panel.ZIndex="1" Content="{Binding Path=FrameSource}"/>
using SpeedportHybridControl.Implementations;
using System.Windows.Controls;
using SpeedportHybridControl.page;
+using System.Windows.Media;
namespace SpeedportHybridControl.Model {
class MainWindowModel : SuperViewModel {
private bool _buttonLanPageIsActive = false;
private bool _buttonControlsPageIsActive = false;
+ private Brush _buttonLoginPageBackground = Brushes.LightGray;
+ private Brush _buttonStatusPageBackground = Brushes.LightGray;
+ private Brush _buttonOverviewPageBackground = Brushes.LightGray;
+ private Brush _buttonDSLPageBackground = Brushes.LightGray;
+ private Brush _buttonLteInfoPageBackground = Brushes.LightGray;
+ private Brush _buttonSyslogPageBackground = Brushes.LightGray;
+ private Brush _buttonTR181PageBackground = Brushes.LightGray;
+ private Brush _buttonPhonePageBackground = Brushes.LightGray;
+ private Brush _buttonLanPageBackground = Brushes.LightGray;
+ private Brush _buttonControlsPageBackground = Brushes.LightGray;
+ private Brush _buttonAboutPageBackground = Brushes.LightGray;
+
private Page _FrameSource;
public DelegateCommand SwitchToLoginPage {
set { SetProperty(ref _buttonControlsPageIsActive, value); }
}
+ public Brush ButtonLoginPageBackground {
+ get { return _buttonLoginPageBackground; }
+ set { SetProperty(ref _buttonLoginPageBackground, value); }
+ }
+
+ public Brush ButtonStatusPageBackground {
+ get { return _buttonStatusPageBackground; }
+ set { SetProperty(ref _buttonStatusPageBackground, value); }
+ }
+
+ public Brush ButtonOverviewPageBackground {
+ get { return _buttonOverviewPageBackground; }
+ set { SetProperty(ref _buttonOverviewPageBackground, value); }
+ }
+
+ public Brush ButtonDSLPageBackground {
+ get { return _buttonDSLPageBackground; }
+ set { SetProperty(ref _buttonDSLPageBackground, value); }
+ }
+
+ public Brush ButtonLteInfoPageBackground {
+ get { return _buttonLteInfoPageBackground; }
+ set { SetProperty(ref _buttonLteInfoPageBackground, value); }
+ }
+
+ public Brush ButtonSyslogPageBackground {
+ get { return _buttonSyslogPageBackground; }
+ set { SetProperty(ref _buttonSyslogPageBackground, value); }
+ }
+
+ public Brush ButtonTR181PageBackground {
+ get { return _buttonTR181PageBackground; }
+ set { SetProperty(ref _buttonTR181PageBackground, value); }
+ }
+
+ public Brush ButtonPhonePageBackground {
+ get { return _buttonPhonePageBackground; }
+ set { SetProperty(ref _buttonPhonePageBackground, value); }
+ }
+
+ public Brush ButtonLanPageBackground {
+ get { return _buttonLanPageBackground; }
+ set { SetProperty(ref _buttonLanPageBackground, value); }
+ }
+
+ public Brush ButtonControlsPageBackground {
+ get { return _buttonControlsPageBackground; }
+ set { SetProperty(ref _buttonControlsPageBackground, value); }
+ }
+
+ public Brush ButtonAboutPageBackground {
+ get { return _buttonAboutPageBackground; }
+ set { SetProperty(ref _buttonAboutPageBackground, value); }
+ }
+
public Page FrameSource {
get { return _FrameSource; }
set { SetProperty(ref _FrameSource, value); }
private void OnSwitchToLoginPageExecute () {
FrameSource = new LoginPage();
+ changeColor("login");
}
private void OnSwitchToStatusPageExecute () {
FrameSource = new StatusPage();
+ changeColor("status");
}
private void OnSwitchToOverviewPageExecute () {
FrameSource = new OverviewPage();
+ changeColor("overview");
}
private void OnSwitchToDSLPageExecute () {
FrameSource = new DslPage();
+ changeColor("dsl");
}
private void OnSwitchToLteInfoPageExecute () {
FrameSource = new LteInfoPage();
+ changeColor("lte");
}
private void OnSwitchToSyslogPageExecute () {
FrameSource = new SyslogPage();
+ changeColor("syslog");
}
private void OnSwitchToTR181PageExecute () {
FrameSource = new TR181Page();
+ changeColor("tr181");
}
private void OnSwitchToPhonePageExecute () {
FrameSource = new PhonePage();
+ changeColor("phone");
}
private void OnSwitchToLanPageExecute () {
FrameSource = new LanPage();
+ changeColor("lan");
}
private void OnSwitchToControlsPageExecute () {
FrameSource = new ControlsPage();
+ changeColor("controls");
}
private void OnSwitchToAboutPageExecute () {
ButtonLanPageIsActive = true;
ButtonControlsPageIsActive = true;
FrameSource = new AboutPage();
+ changeColor("about");
}
-
+
+ public void changeColor (string sender) {
+ ButtonLoginPageBackground = Brushes.LightGray;
+ ButtonStatusPageBackground = Brushes.LightGray;
+ ButtonOverviewPageBackground = Brushes.LightGray;
+ ButtonDSLPageBackground = Brushes.LightGray;
+ ButtonLteInfoPageBackground = Brushes.LightGray;
+ ButtonSyslogPageBackground = Brushes.LightGray;
+ ButtonTR181PageBackground = Brushes.LightGray;
+ ButtonPhonePageBackground = Brushes.LightGray;
+ ButtonLanPageBackground = Brushes.LightGray;
+ ButtonControlsPageBackground = Brushes.LightGray;
+ ButtonAboutPageBackground = Brushes.LightGray;
+
+
+ if (sender.Equals("login")) {
+ ButtonLoginPageBackground = Brushes.LightGreen;
+ }
+
+ if (sender.Equals("status")) {
+ ButtonStatusPageBackground = Brushes.LightGreen;
+ }
+
+ if (sender.Equals("overview")) {
+ ButtonOverviewPageBackground = Brushes.LightGreen;
+ }
+
+ if (sender.Equals("dsl")) {
+ ButtonDSLPageBackground = Brushes.LightGreen;
+ }
+
+ if (sender.Equals("lte")) {
+ ButtonLteInfoPageBackground = Brushes.LightGreen;
+ }
+
+ if (sender.Equals("syslog")) {
+ ButtonSyslogPageBackground = Brushes.LightGreen;
+ }
+
+ if (sender.Equals("tr181")) {
+ ButtonTR181PageBackground = Brushes.LightGreen;
+ }
+
+ if (sender.Equals("phone")) {
+ ButtonPhonePageBackground = Brushes.LightGreen;
+ }
+
+ if (sender.Equals("lan")) {
+ ButtonLanPageBackground = Brushes.LightGreen;
+ }
+
+ if (sender.Equals("controls")) {
+ ButtonControlsPageBackground = Brushes.LightGreen;
+ }
+
+ if (sender.Equals("about")) {
+ ButtonAboutPageBackground = Brushes.LightGreen;
+ }
+ }
+
public MainWindowModel () {
FrameSource = new LoginPage();
+ changeColor("login");
SwitchToLoginPage = new DelegateCommand(new Action(OnSwitchToLoginPageExecute));
SwitchToStatusPage = new DelegateCommand(new Action(OnSwitchToStatusPageExecute));