MainWindow geändert, dynamische Menu erzeugt
This commit is contained in:
@@ -12,5 +12,10 @@ namespace KanSan.Base.Interfaces.UI
|
|||||||
string PunktUnten { get; set; }
|
string PunktUnten { get; set; }
|
||||||
int Durchmesser { get; set; }
|
int Durchmesser { get; set; }
|
||||||
string Material { get; set; }
|
string Material { get; set; }
|
||||||
|
bool RohrleitungInBetrieb { get; set; }
|
||||||
|
bool WasserHaltungDurchgefuehrt { get; set; }
|
||||||
|
bool HaltungGespuelt { get; set; }
|
||||||
|
bool GenehmigungErforderlich { get; set; }
|
||||||
|
bool BaustellenAbsicherung { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,12 @@ using KanSan.Base.Interfaces.UI;
|
|||||||
using KanSan.Base.Models;
|
using KanSan.Base.Models;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace KanSan.ViewModel
|
namespace KanSan.ViewModel
|
||||||
{
|
{
|
||||||
public class ObjekteEditViewModel : IObjekteEditViewModel
|
public class ObjekteEditViewModel : PropertyChangedClass,IObjekteEditViewModel, INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
IUnitOfWork unitOfWork = new UnitOfWork(new KanSanContext());
|
IUnitOfWork unitOfWork = new UnitOfWork(new KanSanContext());
|
||||||
string strassename;
|
string strassename;
|
||||||
@@ -17,15 +18,127 @@ namespace KanSan.ViewModel
|
|||||||
string punktUnten;
|
string punktUnten;
|
||||||
int durchmesser;
|
int durchmesser;
|
||||||
string material;
|
string material;
|
||||||
|
bool rohrleitungInBetrieb;
|
||||||
|
bool wasserHaltungdurchgefuehrt;
|
||||||
|
bool haltungGespuelt;
|
||||||
|
bool genehmigungErforderlich;
|
||||||
|
bool baustellenAbsicherung;
|
||||||
|
|
||||||
private Sewer objekt;
|
private Sewer objekt;
|
||||||
|
|
||||||
public string StrasseName { get => strassename; set => throw new NotImplementedException(); }
|
#region gettersetters
|
||||||
public string Objektnummer { get => objektnummer; set => throw new NotImplementedException(); }
|
public string StrasseName
|
||||||
public string PunktOben { get => punktOben; set => throw new NotImplementedException(); }
|
{
|
||||||
public string PunktUnten { get => punktUnten; set => throw new NotImplementedException(); }
|
get => strassename;
|
||||||
public int Durchmesser { get => durchmesser; set => throw new NotImplementedException(); }
|
set
|
||||||
public string Material { get => material; set => throw new NotImplementedException(); }
|
{
|
||||||
|
if (strassename == value) return;
|
||||||
|
strassename = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string Objektnummer
|
||||||
|
{
|
||||||
|
get => objektnummer;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (objektnummer == value) return;
|
||||||
|
objektnummer = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string PunktOben
|
||||||
|
{
|
||||||
|
get => punktOben;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (punktOben == value) return;
|
||||||
|
punktOben = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string PunktUnten
|
||||||
|
{
|
||||||
|
get => punktUnten;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (punktUnten == value) return;
|
||||||
|
punktUnten = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public int Durchmesser
|
||||||
|
{
|
||||||
|
get => durchmesser;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (durchmesser == value) return;
|
||||||
|
durchmesser = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string Material
|
||||||
|
{
|
||||||
|
get => material;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (material == value) return;
|
||||||
|
material = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public bool RohrleitungInBetrieb
|
||||||
|
{
|
||||||
|
get => rohrleitungInBetrieb;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (rohrleitungInBetrieb == value) return;
|
||||||
|
rohrleitungInBetrieb = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public bool WasserHaltungDurchgefuehrt
|
||||||
|
{
|
||||||
|
get => wasserHaltungdurchgefuehrt;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (wasserHaltungdurchgefuehrt == value) return;
|
||||||
|
wasserHaltungdurchgefuehrt = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public bool HaltungGespuelt
|
||||||
|
{
|
||||||
|
get => haltungGespuelt;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (haltungGespuelt == value) return;
|
||||||
|
haltungGespuelt = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public bool GenehmigungErforderlich
|
||||||
|
{
|
||||||
|
get => genehmigungErforderlich;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (genehmigungErforderlich == value) return;
|
||||||
|
genehmigungErforderlich = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public bool BaustellenAbsicherung
|
||||||
|
{
|
||||||
|
get => baustellenAbsicherung;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (baustellenAbsicherung == value) return;
|
||||||
|
baustellenAbsicherung = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
public ObjekteEditViewModel(Sewer sewer)
|
public ObjekteEditViewModel(Sewer sewer)
|
||||||
{
|
{
|
||||||
@@ -36,12 +149,22 @@ namespace KanSan.ViewModel
|
|||||||
objektnummer = objekt.ObjektNummer;
|
objektnummer = objekt.ObjektNummer;
|
||||||
durchmesser = objekt.DN;
|
durchmesser = objekt.DN;
|
||||||
material = objekt.Material.ToString();
|
material = objekt.Material.ToString();
|
||||||
|
rohrleitungInBetrieb = objekt.RohrleitungInBetrieb;
|
||||||
|
wasserHaltungdurchgefuehrt = objekt.WasserHaltungDurchgefuehrt;
|
||||||
|
haltungGespuelt = objekt.HaltungGespuelt;
|
||||||
|
genehmigungErforderlich = objekt.GenehmigungErforderlich;
|
||||||
|
baustellenAbsicherung = objekt.BaustellensicherungErforderlich;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Speichern()
|
public void Speichern()
|
||||||
{
|
{
|
||||||
objekt.StrasseName = strassename;
|
objekt.StrasseName = strassename;
|
||||||
objekt.DN = durchmesser;
|
objekt.DN = durchmesser;
|
||||||
|
objekt.RohrleitungInBetrieb = rohrleitungInBetrieb;
|
||||||
|
objekt.WasserHaltungDurchgefuehrt = wasserHaltungdurchgefuehrt;
|
||||||
|
objekt.BaustellensicherungErforderlich = baustellenAbsicherung;
|
||||||
|
objekt.HaltungGespuelt = haltungGespuelt;
|
||||||
|
objekt.GenehmigungErforderlich = genehmigungErforderlich;
|
||||||
|
|
||||||
unitOfWork.KanaeleRepository.Update(objekt);
|
unitOfWork.KanaeleRepository.Update(objekt);
|
||||||
unitOfWork.Commit();
|
unitOfWork.Commit();
|
||||||
|
|||||||
28
KanSan.ViewModel/SewerMainMenuViewModel.cs
Normal file
28
KanSan.ViewModel/SewerMainMenuViewModel.cs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
using KanSan.Base.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace KanSan.ViewModel
|
||||||
|
{
|
||||||
|
public class SewerMainMenuViewModel : PropertyChangedClass,INotifyPropertyChanged
|
||||||
|
{
|
||||||
|
private Sewer model;
|
||||||
|
|
||||||
|
public string ObjektBezeichnung
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return model.ObjektNummer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public SewerMainMenuViewModel(Sewer model)
|
||||||
|
{
|
||||||
|
if (model == null) throw new ArgumentNullException();
|
||||||
|
this.model = model;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -37,6 +37,9 @@
|
|||||||
<Compile Update="UI\Objekte\UCObjektEdit.xaml.cs">
|
<Compile Update="UI\Objekte\UCObjektEdit.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Update="UI\UCSewerMainMenu.xaml.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Page Update="MainWindow.xaml">
|
<Page Update="MainWindow.xaml">
|
||||||
@@ -75,5 +78,8 @@
|
|||||||
<Page Update="UI\Objekte\UCObjektEdit.xaml">
|
<Page Update="UI\Objekte\UCObjektEdit.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Update="UI\UCSewerMainMenu.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<RadioButton Name="rbProjekte" Content="Projekte" Style="{StaticResource ToggelButtonList}" Checked="rbProjekte_Checked" />
|
<RadioButton Name="rbProjekte" Content="Projekte" Style="{StaticResource ToggelButtonList}" Checked="rbProjekte_Checked" />
|
||||||
<RadioButton Name="rbBaustellen" Content="Baustellen" Style="{StaticResource ToggelButtonList}" Checked="rbBaustellen_Checked" />
|
<RadioButton Name="rbBaustellen" Content="Baustellen" Style="{StaticResource ToggelButtonList}" Checked="rbBaustellen_Checked" />
|
||||||
<RadioButton x:Name="rbObjekte" Content="Objekte" Style="{StaticResource ToggelButtonList}" Checked="rbObjekte_Checked" />
|
<RadioButton x:Name="rbObjekte" Content="Objekte" Style="{StaticResource ToggelButtonList}" Checked="rbObjekte_Checked" />
|
||||||
|
<ContentControl Name="SewerMainMenu" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<ContentControl Grid.Column="1" Name="ContentController" Content="KanSan"/>
|
<ContentControl Grid.Column="1" Name="ContentController" Content="KanSan"/>
|
||||||
<StatusBar Grid.ColumnSpan="2" Margin="0,1,0,0" Grid.Row="1">
|
<StatusBar Grid.ColumnSpan="2" Margin="0,1,0,0" Grid.Row="1">
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ namespace KanSan
|
|||||||
UI.UCProjektList UCProjektList;
|
UI.UCProjektList UCProjektList;
|
||||||
UI.UCBaustelleList UCBaustelleList;
|
UI.UCBaustelleList UCBaustelleList;
|
||||||
|
|
||||||
|
UI.UCSewerMainMenu uCSewerMainMenu;
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@@ -111,9 +113,28 @@ namespace KanSan
|
|||||||
{
|
{
|
||||||
if (e.Objekt == null) return;
|
if (e.Objekt == null) return;
|
||||||
(DataContext as MainWindowViewModel).SelectedObjekt = e.Objekt;
|
(DataContext as MainWindowViewModel).SelectedObjekt = e.Objekt;
|
||||||
UI.UCObjektEdit uCObjektEdit = new UI.UCObjektEdit();
|
rbObjekte.IsChecked = false;
|
||||||
ContentController.Content = uCObjektEdit;
|
|
||||||
//Debugger.Break();
|
uCSewerMainMenu = new UI.UCSewerMainMenu(e.Objekt);
|
||||||
|
|
||||||
|
uCSewerMainMenu.SewerMainMenuSelected += UCSewerMainMenu_SewerMainMenuSelected;
|
||||||
|
SewerMainMenu.Content = uCSewerMainMenu;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UCSewerMainMenu_SewerMainMenuSelected(object sender, UI.SewerMainMenuItemSelectedEventArgs e)
|
||||||
|
{
|
||||||
|
Sewer actualSelectedSewer = (DataContext as MainWindowViewModel).SelectedObjekt;
|
||||||
|
switch(e.Command)
|
||||||
|
{
|
||||||
|
case UI.ESewerMainMenuCommand.STAMMDATEN:
|
||||||
|
ContentController.Content = new UI.UCObjektEdit(actualSelectedSewer);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case UI.ESewerMainMenuCommand.NONE:
|
||||||
|
ContentController.Content = "Wird nicht unterstützt";
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void rbKunden_Checked(object sender, RoutedEventArgs e)
|
private void rbKunden_Checked(object sender, RoutedEventArgs e)
|
||||||
|
|||||||
50
KanSan/SampleData/ObjekteEditViewModelSampleData.cs
Normal file
50
KanSan/SampleData/ObjekteEditViewModelSampleData.cs
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
using KanSan.Base.Interfaces.UI;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace KanSan.SampleData
|
||||||
|
{
|
||||||
|
class ObjekteEditViewModelSampleData : IObjekteEditViewModel
|
||||||
|
{
|
||||||
|
string strasseName;
|
||||||
|
string objektnummer;
|
||||||
|
string punktOben;
|
||||||
|
string punktUnten;
|
||||||
|
int durchmesser;
|
||||||
|
string material;
|
||||||
|
bool rohrleitungInBetrieb;
|
||||||
|
bool wasserHaltungdurchgefuehrt;
|
||||||
|
bool haltungGespuelt;
|
||||||
|
bool genehmigungErforderlich;
|
||||||
|
bool baustellenAbsicherung;
|
||||||
|
|
||||||
|
|
||||||
|
public string StrasseName { get => strasseName; set => throw new NotImplementedException(); }
|
||||||
|
public string Objektnummer { get => objektnummer; set => throw new NotImplementedException(); }
|
||||||
|
public string PunktOben { get => punktOben; set => throw new NotImplementedException(); }
|
||||||
|
public string PunktUnten { get => punktUnten; set => throw new NotImplementedException(); }
|
||||||
|
public int Durchmesser { get => durchmesser; set => throw new NotImplementedException(); }
|
||||||
|
public string Material { get => material; set => throw new NotImplementedException(); }
|
||||||
|
public bool RohrleitungInBetrieb { get => rohrleitungInBetrieb; set => throw new NotImplementedException(); }
|
||||||
|
public bool WasserHaltungDurchgefuehrt { get => wasserHaltungdurchgefuehrt; set => throw new NotImplementedException(); }
|
||||||
|
public bool HaltungGespuelt { get => haltungGespuelt; set => throw new NotImplementedException(); }
|
||||||
|
public bool GenehmigungErforderlich { get => genehmigungErforderlich; set => throw new NotImplementedException(); }
|
||||||
|
public bool BaustellenAbsicherung { get => baustellenAbsicherung; set => throw new NotImplementedException(); }
|
||||||
|
|
||||||
|
public ObjekteEditViewModelSampleData()
|
||||||
|
{
|
||||||
|
strasseName = "Grader Weg";
|
||||||
|
objektnummer = "SW01";
|
||||||
|
punktOben = objektnummer;
|
||||||
|
punktUnten = "SW02";
|
||||||
|
durchmesser = 150;
|
||||||
|
material = "Steinzeug";
|
||||||
|
rohrleitungInBetrieb = false;
|
||||||
|
wasserHaltungdurchgefuehrt = true;
|
||||||
|
haltungGespuelt = true;
|
||||||
|
genehmigungErforderlich = false;
|
||||||
|
baustellenAbsicherung = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,9 +4,14 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:self="clr-namespace:KanSan.ViewModel;assembly=KanSan.ViewModel"
|
xmlns:self="clr-namespace:KanSan.ViewModel;assembly=KanSan.ViewModel"
|
||||||
|
xmlns:iself ="clr-namespace:KanSan.Base.Interfaces.UI;assembly=KanSan.Base"
|
||||||
xmlns:local="clr-namespace:KanSan.UI"
|
xmlns:local="clr-namespace:KanSan.UI"
|
||||||
|
xmlns:sd="clr-namespace:KanSan.SampleData"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450" d:DesignWidth="800" Background="LightGray">
|
d:DesignHeight="450" d:DesignWidth="800" Background="LightGray">
|
||||||
|
<d:UserControl.DataContext>
|
||||||
|
<sd:ObjekteEditViewModelSampleData GenehmigungErforderlich="True" />
|
||||||
|
</d:UserControl.DataContext>
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
@@ -23,12 +28,13 @@
|
|||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
<Button Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" Content="Speichern" Name="Speichern" Click="Speichern_Click"/>
|
||||||
<StackPanel Grid.Column="1">
|
<StackPanel Grid.Column="1">
|
||||||
<CheckBox Content="Rohrleitung in Betrieb" IsChecked="True" Style="{StaticResource checkBoxCircle}"/>
|
<CheckBox Content="Rohrleitung in Betrieb" IsChecked="{Binding Path=(iself:IObjekteEditViewModel.RohrleitungInBetrieb)}" Style="{StaticResource checkBoxCircle}"/>
|
||||||
<CheckBox Content="Wasserhaltung durchgeführt" IsChecked="True" Style="{StaticResource checkBoxCircle}" />
|
<CheckBox Content="Wasserhaltung durchgeführt" IsChecked="{Binding Path=(iself:IObjekteEditViewModel.WasserHaltungDurchgefuehrt)}" Style="{StaticResource checkBoxCircle}" />
|
||||||
<CheckBox Content="Haltung gespült" IsChecked="True" Style="{StaticResource checkBoxCircle}" />
|
<CheckBox Content="Haltung gespült" IsChecked="{Binding Path=(iself:IObjekteEditViewModel.HaltungGespuelt)}" Style="{StaticResource checkBoxCircle}" />
|
||||||
<CheckBox Content="Genehmigung Erforderlich" IsChecked="True" Style="{StaticResource checkBoxCircle}" />
|
<CheckBox Content="Genehmigung Erforderlich" IsChecked="{Binding Path=(iself:IObjekteEditViewModel.GenehmigungErforderlich)}" Style="{StaticResource checkBoxCircle}" />
|
||||||
<CheckBox Content="Baustellen sicherung erforderlich" IsChecked="False" Style="{StaticResource checkBoxCircle}" />
|
<CheckBox Content="Baustellen sicherung erforderlich" IsChecked="{Binding Path=(iself:IObjekteEditViewModel.BaustellenAbsicherung)}" Style="{StaticResource checkBoxCircle}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Grid Grid.Column="0">
|
<Grid Grid.Column="0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
@@ -50,11 +56,11 @@
|
|||||||
<Label Grid.Row="4" Grid.Column="0" Content="Durchmesser" />
|
<Label Grid.Row="4" Grid.Column="0" Content="Durchmesser" />
|
||||||
<Label Grid.Row="5" Grid.Column="0" Content="Material" />
|
<Label Grid.Row="5" Grid.Column="0" Content="Material" />
|
||||||
|
|
||||||
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Strassename}" />
|
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Path=(iself:IObjekteEditViewModel.StrasseName)}" />
|
||||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding OberePunkt}" />
|
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Path=(iself:IObjekteEditViewModel.PunktOben)}" />
|
||||||
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding UnterePunkt}" />
|
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding Path=(iself:IObjekteEditViewModel.PunktUnten)}" />
|
||||||
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding Objektnummer}" />
|
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding Path=(iself:IObjekteEditViewModel.Objektnummer)}" />
|
||||||
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding DN}" />
|
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding Path=(iself:IObjekteEditViewModel.Durchmesser)}" />
|
||||||
<ComboBox Grid.Row="5" Grid.Column="1">
|
<ComboBox Grid.Row="5" Grid.Column="1">
|
||||||
<ComboBoxItem Content="Lala" />
|
<ComboBoxItem Content="Lala" />
|
||||||
<ComboBoxItem Content="Haha" />
|
<ComboBoxItem Content="Haha" />
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using System;
|
using KanSan.Base.Models;
|
||||||
|
using KanSan.ViewModel;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
@@ -18,9 +20,15 @@ namespace KanSan.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class UCObjektEdit : UserControl
|
public partial class UCObjektEdit : UserControl
|
||||||
{
|
{
|
||||||
public UCObjektEdit()
|
public UCObjektEdit(Sewer objekt)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
this.DataContext = new ObjekteEditViewModel(objekt);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Speichern_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
(DataContext as ObjekteEditViewModel).Speichern();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
28
KanSan/UI/UCSewerMainMenu.xaml
Normal file
28
KanSan/UI/UCSewerMainMenu.xaml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<UserControl x:Class="KanSan.UI.UCSewerMainMenu"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:self="clr-namespace:KanSan.ViewModel;assembly=KanSan.ViewModel"
|
||||||
|
xmlns:local="clr-namespace:KanSan.UI"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="450" d:DesignWidth="800">
|
||||||
|
<UserControl.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<ResourceDictionary Source="./../my_controls.xaml" />
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</UserControl.Resources>
|
||||||
|
<Grid>
|
||||||
|
|
||||||
|
<StackPanel Name="MenuItems">
|
||||||
|
<TextBlock Text="{Binding Path=(self:SewerMainMenuViewModel.ObjektBezeichnung)}" />
|
||||||
|
<RadioButton Name="rbStammdaten" Checked="rbSewerMenuItem_Checked" Style="{StaticResource ToggelButtonList}" Content="Stammdaten" />
|
||||||
|
<RadioButton Name="rbSchaeden" Checked="rbSewerMenuItem_Checked" Style="{StaticResource ToggelButtonList}" Content="Schäden" />
|
||||||
|
<RadioButton Name="rbSchlauch1" Checked="rbSewerMenuItem_Checked" Style="{StaticResource ToggelButtonList}" Content="Schlauchliner" />
|
||||||
|
<RadioButton Name="rbSchachtAnb1" Checked="rbSewerMenuItem_Checked" Style="{StaticResource ToggelButtonList}" Content="Schachtanbindung 1" />
|
||||||
|
<RadioButton Name="Kurzliner1" Checked="rbSewerMenuItem_Checked" Style="{StaticResource ToggelButtonList}" Content="Kurzliner" />
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
76
KanSan/UI/UCSewerMainMenu.xaml.cs
Normal file
76
KanSan/UI/UCSewerMainMenu.xaml.cs
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
using KanSan.Base.Models;
|
||||||
|
using KanSan.ViewModel;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Text;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Data;
|
||||||
|
using System.Windows.Documents;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
using System.Windows.Navigation;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
|
namespace KanSan.UI
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaktionslogik für UCSewerMainMenu.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class UCSewerMainMenu : UserControl
|
||||||
|
{
|
||||||
|
public event EventHandler<SewerMainMenuItemSelectedEventArgs> SewerMainMenuSelected;
|
||||||
|
|
||||||
|
protected virtual void OnSewerMenuSelected(SewerMainMenuItemSelectedEventArgs e)
|
||||||
|
{
|
||||||
|
EventHandler<SewerMainMenuItemSelectedEventArgs> handler = SewerMainMenuSelected;
|
||||||
|
if (handler != null)
|
||||||
|
handler(this, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UCSewerMainMenu(Sewer objekt)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.DataContext = new SewerMainMenuViewModel(objekt);
|
||||||
|
Style style = this.FindResource("ToggelButtonList") as Style;
|
||||||
|
|
||||||
|
RadioButton radioButton = new RadioButton();
|
||||||
|
radioButton.Name = "Schlauch122123";
|
||||||
|
radioButton.Content = "Schlauchliner";
|
||||||
|
radioButton.Style = style;
|
||||||
|
radioButton.Checked += rbSewerMenuItem_Checked;
|
||||||
|
|
||||||
|
MenuItems.Children.Add(radioButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void rbSewerMenuItem_Checked(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
RadioButton radioButton = (RadioButton)sender;
|
||||||
|
if (radioButton == null) return;
|
||||||
|
//Debugger.Break();
|
||||||
|
ESewerMainMenuCommand command = ESewerMainMenuCommand.NONE;
|
||||||
|
if (radioButton.Name.Equals("rbStammdaten")) command = ESewerMainMenuCommand.STAMMDATEN;
|
||||||
|
else if (radioButton.Name.Equals("rbSchaeden")) command = ESewerMainMenuCommand.SCHAEDEN;
|
||||||
|
|
||||||
|
OnSewerMenuSelected(new SewerMainMenuItemSelectedEventArgs()
|
||||||
|
{
|
||||||
|
Command = command
|
||||||
|
}) ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum ESewerMainMenuCommand
|
||||||
|
{
|
||||||
|
NONE,
|
||||||
|
STAMMDATEN,
|
||||||
|
SCHAEDEN,
|
||||||
|
SANIERUNG
|
||||||
|
}
|
||||||
|
public class SewerMainMenuItemSelectedEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public ESewerMainMenuCommand Command { get; set; }
|
||||||
|
public int Parameter { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user