Design geändert

This commit is contained in:
Husky
2020-03-19 09:58:59 +01:00
parent ed2eb35be4
commit 7c475e1c35
10 changed files with 194 additions and 9 deletions

View File

@@ -0,0 +1,20 @@
<UserControl x:Class="KanSan.UI.UCObjektEdit"
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:local="clr-namespace:KanSan.UI"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" Background="LightGray">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="./../../my_controls.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<CheckBox Content="Rohrleitung in Betrieb" IsChecked="True" Style="{StaticResource checkBoxCircle}"/>
<!--<RadioButton Name="my" Content="Rohrleitung in Betrieb" Style="{StaticResource ToggelButtonList}" />-->
</Grid>
</UserControl>

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
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 UCObjektEdit.xaml
/// </summary>
public partial class UCObjektEdit : UserControl
{
public UCObjektEdit()
{
InitializeComponent();
}
}
}

View File

@@ -19,7 +19,7 @@
<RowDefinition Height="50" />
<RowDefinition Height="50" />
</Grid.RowDefinitions>
<TreeView Name="trvStreets" ItemsSource="{Binding KanalObjekte}">
<TreeView Name="trvItems" ItemsSource="{Binding KanalObjekte}" MouseDoubleClick="trvItems_MouseDoubleClick">
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type self:ObjekteTransfer}" ItemsSource="{Binding Objekte}">
<StackPanel Orientation="Horizontal">
@@ -31,14 +31,14 @@
</HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type model:Sewer}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Von [" />
<TextBlock Text="{Binding PunktOben.Objektnummer}"/>
<TextBlock Text="[" />
<TextBlock Text="{Binding PunktOben.Objektnummer}" Foreground="Blue"/>
<TextBlock Text="] Nach [" />
<TextBlock Text="{Binding PunktUnten.Objektnummer}" />
<TextBlock Text="{Binding PunktUnten.Objektnummer}" Foreground="Blue" />
<TextBlock Text="] DN [" />
<TextBlock Text="{Binding DN}"/>
<TextBlock Text="{Binding DN}" Foreground="Blue"/>
<TextBlock Text="] Material ["/>
<TextBlock Text="{Binding Material}" />
<TextBlock Text="{Binding Material}" Foreground="Blue" />
<TextBlock Text="]" />
</StackPanel>
</DataTemplate>

View File

@@ -2,6 +2,7 @@
using KanSan.ViewModel;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Windows;
using System.Windows.Controls;
@@ -20,6 +21,7 @@ namespace KanSan.UI
/// </summary>
public partial class UCObjekteList : UserControl
{
public event EventHandler<ObjektSelectEventArgs> ObjektSelected;
Baustelle baustelle;
public UCObjekteList(Baustelle baustelle)
{
@@ -33,5 +35,27 @@ namespace KanSan.UI
FrmNewObjekt frmNewObjekt = new FrmNewObjekt(baustelle);
frmNewObjekt.ShowDialog();
}
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 });
}
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; }
}
}