Umbau
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" Content="Speichern" Name="Speichern" Click="Speichern_Click"/>
|
||||
<Button Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" Content="Speichern" Name="Speichern" />
|
||||
<StackPanel Grid.Column="1">
|
||||
<CheckBox Content="Rohrleitung in Betrieb" IsChecked="{Binding Path=(iself:IObjekteEditViewModel.RohrleitungInBetrieb)}" Style="{StaticResource checkBoxCircle}"/>
|
||||
<CheckBox Content="Wasserhaltung durchgeführt" IsChecked="{Binding Path=(iself:IObjekteEditViewModel.WasserHaltungDurchgefuehrt)}" Style="{StaticResource checkBoxCircle}" />
|
||||
|
||||
@@ -20,15 +20,10 @@ namespace KanSan.UI
|
||||
/// </summary>
|
||||
public partial class UCObjektEdit : UserControl
|
||||
{
|
||||
public UCObjektEdit(Sewer objekt)
|
||||
public UCObjektEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new ObjekteEditViewModel(objekt);
|
||||
}
|
||||
|
||||
private void Speichern_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(DataContext as ObjekteEditViewModel).Speichern();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,14 +19,8 @@
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="50" />
|
||||
</Grid.RowDefinitions>
|
||||
<TreeView Name="trvItems" ItemsSource="{Binding KanalObjekte}" >
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}">
|
||||
<Setter Property="local:MouseLeftButtonUp.Command" Value="{Binding DataContext.ObjektSelected, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type TreeView}}}" />
|
||||
<Setter Property="local:MouseLeftButtonUp.CommandParamter"
|
||||
Value="{Binding ElementName=trvItems, Path=SelectedItem}"/>
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
<TreeView Name="trvItems" ItemsSource="{Binding KanalObjekte}" MouseDoubleClick="trvItems_MouseDoubleClick" >
|
||||
|
||||
<TreeView.Resources>
|
||||
<HierarchicalDataTemplate DataType="{x:Type self:ObjekteTransfer}" ItemsSource="{Binding Objekte}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
@@ -51,7 +45,7 @@
|
||||
</DataTemplate>
|
||||
</TreeView.Resources>
|
||||
</TreeView>
|
||||
<Button Grid.Row="1" x:Name="ProjektSelect" Content="Objekt Auswählen" />
|
||||
<Button Grid.Row="1" x:Name="ProjektSelect" Content="Objekt Auswählen" Command="{Binding ObjektSelected}" />
|
||||
<Button Grid.Row="2" Name="ProjektEdit" Content="Objekt Editieren" />
|
||||
<Button Grid.Row="3" Name="ObjektNew" Content="Neue Objekt Hinzufügen" Click="ObjektNew_Click" />
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace KanSan.UI
|
||||
control.MouseLeftButtonUp += OnMouseLeftButtonUp;
|
||||
else if ((e.NewValue == null) && (e.OldValue != null))
|
||||
control.MouseLeftButtonUp -= OnMouseLeftButtonUp;
|
||||
|
||||
|
||||
}
|
||||
private static void OnMouseLeftButtonUp(object sender, RoutedEventArgs e)
|
||||
{
|
||||
@@ -67,7 +67,7 @@ namespace KanSan.UI
|
||||
/// </summary>
|
||||
public partial class UCObjekteList : UserControl
|
||||
{
|
||||
public event EventHandler<ObjektSelectEventArgs> ObjektSelected;
|
||||
|
||||
Baustelle baustelle;
|
||||
public UCObjekteList()
|
||||
{
|
||||
@@ -88,24 +88,17 @@ namespace KanSan.UI
|
||||
|
||||
private void trvItems_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
|
||||
TreeView treeView = (TreeView)sender;
|
||||
if (treeView == null) return;
|
||||
if (!(treeView.SelectedItem is Sewer)) return;
|
||||
Sewer sewer = (Sewer)treeView.SelectedItem;
|
||||
if (sewer == null) return;
|
||||
OnObjektSelectKlick(new ObjektSelectEventArgs() { Objekt = sewer });
|
||||
SewerMainWindow sewerMainWindow = new SewerMainWindow();
|
||||
sewerMainWindow.DataContext = new SewerMainWindowViewModel(sewer);
|
||||
sewerMainWindow.ShowDialog();
|
||||
|
||||
}
|
||||
|
||||
protected virtual void OnObjektSelectKlick(ObjektSelectEventArgs e)
|
||||
{
|
||||
EventHandler<ObjektSelectEventArgs> handler = ObjektSelected;
|
||||
if (handler != null)
|
||||
handler(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
public class ObjektSelectEventArgs : EventArgs
|
||||
{
|
||||
public Sewer Objekt { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Button Grid.Row="1" Name="NewSchaden" Click="NewSchaden_Click" Content="Neue Schäden Hinzufügen" />
|
||||
<Button Grid.Row="1" Name="NewSchaden" Command="{Binding neueSchadenHinzufügen}" Content="Neue Schäden Hinzufügen" />
|
||||
<Button Grid.Row="2" Name="GenerateExcel" Content="Schadensbericht erstellen" Click="GenerateExcel_Click" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -29,6 +29,11 @@ namespace KanSan.UI
|
||||
this.DataContext = new SchaedenListViewModel(actualSelectedSewer);
|
||||
}
|
||||
|
||||
public UCSchaedenList()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected virtual void OnClickSchaedenSelect(SelectSchaedenEventArgs e)
|
||||
{
|
||||
EventHandler<SelectSchaedenEventArgs> handler = SchaedenSelected;
|
||||
|
||||
@@ -1,12 +1,42 @@
|
||||
<Window x:Class="KanSan.UI.SewerMainWindow"
|
||||
<syncfusion:ChromelessWindow x:Class="KanSan.UI.SewerMainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:syncfusion="clr-namespace:Syncfusion.Windows.Shared;assembly=Syncfusion.Shared.WPF"
|
||||
xmlns:local="clr-namespace:KanSan.UI"
|
||||
mc:Ignorable="d"
|
||||
Title="SewerMainWindow" Height="450" Width="800">
|
||||
mc:Ignorable="d" TitleBarBackground="BlueViolet"
|
||||
Title="SewerMainWindow" Height="450" Width="800" WindowStartupLocation="CenterScreen" WindowState="Maximized">
|
||||
<Window.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="./../my_controls.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="150" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="11*" />
|
||||
<RowDefinition Height="64*" />
|
||||
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
|
||||
<TextBlock Text="{Binding ObjektBezeichnung}" />
|
||||
<!--<TextBlock Text="{Binding Path=(self:SewerMainMenuViewModel.ObjektBezeichnung)}" />
|
||||
<TextBlock Text="{Binding Path=(self:SewerMainMenuViewModel.SchadenEntfernung)}" />-->
|
||||
<TextBlock Text="" />
|
||||
</StackPanel>
|
||||
<!--<TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Text="{Binding Path=(self:SewerMainMenuViewModel.ObjektBezeichnung)}" />-->
|
||||
|
||||
<StackPanel Grid.Column="0" Grid.Row="1" Name="MenuItems">
|
||||
|
||||
<RadioButton Command="{Binding StammdatenSelect}" Style="{StaticResource ToggelButtonList}" Content="Stammdaten" />
|
||||
<RadioButton Command="{Binding SchädenübersichtSelect}" Name="rbSchaeden" Style="{StaticResource ToggelButtonList}" Content="Schäden" />
|
||||
</StackPanel>
|
||||
<ContentControl Grid.Column="1" Grid.Row="1" Content="{Binding AktualView}" Name="ObjektContentcontroller" />
|
||||
</Grid>
|
||||
</Window>
|
||||
</syncfusion:ChromelessWindow>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using KanSan.Base.Models;
|
||||
using KanSan.ViewModel;
|
||||
using Syncfusion.Windows.Shared;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
@@ -17,7 +18,7 @@ namespace KanSan.UI
|
||||
/// <summary>
|
||||
/// Interaktionslogik für SewerMainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class SewerMainWindow : Window
|
||||
public partial class SewerMainWindow : ChromelessWindow
|
||||
{
|
||||
public SewerMainWindow()
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
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:syncfusion="clr-namespace:Syncfusion.Windows.Shared;assembly=Syncfusion.Shared.WPF"
|
||||
xmlns:local="clr-namespace:KanSan.UI"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
|
||||
@@ -25,8 +25,8 @@ namespace KanSan.UI
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new SewerMainWindowViewModel(objekt);
|
||||
UI.UCObjektEdit uCObjektEdit = new UCObjektEdit(objekt);
|
||||
ObjektContentcontroller.Content = uCObjektEdit;
|
||||
//UI.UCObjektEdit uCObjektEdit = new UCObjektEdit(objekt);
|
||||
//ObjektContentcontroller.Content = uCObjektEdit;
|
||||
rbStammdaten.IsChecked = true;
|
||||
|
||||
Style style = this.FindResource("ToggelButtonList") as Style;
|
||||
@@ -42,6 +42,7 @@ namespace KanSan.UI
|
||||
|
||||
private void rbSewerMenuItem_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
/*
|
||||
RadioButton btn = (RadioButton)sender;
|
||||
if (btn == null) return;
|
||||
switch(btn.Name)
|
||||
@@ -58,7 +59,7 @@ namespace KanSan.UI
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
}
|
||||
Schaeden aktuellSchadenSelected = null;
|
||||
private void UCSchaedenList_SanierungsmaßnahmenSelected(object sender, SelectSchaedenEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user