Design geändert
This commit is contained in:
@@ -22,6 +22,7 @@ namespace KanSan.ViewModel
|
|||||||
private Kunde _selectedKunde;
|
private Kunde _selectedKunde;
|
||||||
private Projekt _selectedProjekt;
|
private Projekt _selectedProjekt;
|
||||||
private Baustelle _selectedBaustelle;
|
private Baustelle _selectedBaustelle;
|
||||||
|
private Sewer _selectedObjekt;
|
||||||
|
|
||||||
|
|
||||||
public string ApplicationTitle
|
public string ApplicationTitle
|
||||||
@@ -93,6 +94,23 @@ namespace KanSan.ViewModel
|
|||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Sewer SelectedObjekt
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _selectedObjekt;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if(_selectedObjekt != null)
|
||||||
|
{
|
||||||
|
if (_selectedObjekt.GuidNr.Equals(value.GuidNr)) return;
|
||||||
|
}
|
||||||
|
_selectedObjekt = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
private void SaveInRegistry(string key, string value)
|
private void SaveInRegistry(string key, string value)
|
||||||
{
|
{
|
||||||
Registry.SetValue(REGISTRYKEY, key, value);
|
Registry.SetValue(REGISTRYKEY, key, value);
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ namespace KanSan.ViewModel
|
|||||||
{
|
{
|
||||||
this.selectedBaustelle = selectedBaustelle;
|
this.selectedBaustelle = selectedBaustelle;
|
||||||
//
|
//
|
||||||
List<Sewer> list = unitOfWork.KanaeleRepository.Get(x => x.Baustelle.Equals(selectedBaustelle)).ToList();
|
List<Sewer> list = unitOfWork.KanaeleRepository.Get(x => x.Baustelle.Equals(selectedBaustelle),includeProperties:"PunktOben,PunktUnten").ToList();
|
||||||
var my = unitOfWork.KanaeleRepository.Include(c => c.PunktOben);
|
|
||||||
|
|
||||||
var x = list.GroupBy(x => x.StrasseName).Select(x => new ObjekteTransfer
|
var x = list.GroupBy(x => x.StrasseName).Select(x => new ObjekteTransfer
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,11 +34,17 @@
|
|||||||
<Compile Update="UI\Objekte\UCObjekteList.xaml.cs">
|
<Compile Update="UI\Objekte\UCObjekteList.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Update="UI\Objekte\UCObjektEdit.xaml.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Page Update="MainWindow.xaml">
|
<Page Update="MainWindow.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Update="my_controls.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
<Page Update="UI\Objekte\FrmNewObjekt.xaml">
|
<Page Update="UI\Objekte\FrmNewObjekt.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
@@ -66,5 +72,8 @@
|
|||||||
<Page Update="UI\Objekte\UCObjekteList.xaml">
|
<Page Update="UI\Objekte\UCObjekteList.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Update="UI\Objekte\UCObjektEdit.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -7,6 +7,13 @@
|
|||||||
xmlns:syncfusion="http://schemas.syncfusion.com/wpf" x:Class="KanSan.MainWindow"
|
xmlns:syncfusion="http://schemas.syncfusion.com/wpf" x:Class="KanSan.MainWindow"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="{Binding ApplicationTitle}" Height="450" Width="800" WindowStartupLocation="CenterScreen" WindowState="Maximized">
|
Title="{Binding ApplicationTitle}" 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>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="29*" />
|
<ColumnDefinition Width="29*" />
|
||||||
@@ -17,10 +24,15 @@
|
|||||||
<RowDefinition Height="11*" />
|
<RowDefinition Height="11*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<StackPanel Grid.Column="0">
|
<StackPanel Grid.Column="0">
|
||||||
<Button Content="Kunden" Name="btnKunden" Click="btnKunden_Click" />
|
<RadioButton Name="rbKunden" Content="Kunden" Style="{StaticResource ToggelButtonList}" />
|
||||||
|
<RadioButton Name="rbProjekte" Content="Projekte" Style="{StaticResource ToggelButtonList}" />
|
||||||
|
<RadioButton Name="rbBaustellen" Content="Baustellen" Style="{StaticResource ToggelButtonList}" />
|
||||||
|
<RadioButton x:Name="rbObjekte" Content="Objekte" Style="{StaticResource ToggelButtonList}" />
|
||||||
|
<!-- <Button Content="Kunden" Name="btnKunden" Click="btnKunden_Click" />
|
||||||
<Button Content="Projekte" Name="btnProjekte" Click="btnProjekte_Click" />
|
<Button Content="Projekte" Name="btnProjekte" Click="btnProjekte_Click" />
|
||||||
<Button Content="Baustellen" Name="btnBaustellen" Click="btnBaustellen_Click" />
|
<Button Content="Baustellen" Name="btnBaustellen" Click="btnBaustellen_Click" />
|
||||||
<Button Content="Objekte" Name="btnObjekte" Click="btnObjekte_Click" />
|
<Button Content="Objekte" Name="btnObjekte" Click="btnObjekte_Click" />
|
||||||
|
-->
|
||||||
</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">
|
||||||
|
|||||||
@@ -131,8 +131,18 @@ namespace KanSan
|
|||||||
private void btnObjekte_Click(object sender, RoutedEventArgs e)
|
private void btnObjekte_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
UI.UCObjekteList uCObjekteList = new UI.UCObjekteList((DataContext as MainWindowViewModel).SelectedBaustelle);
|
UI.UCObjekteList uCObjekteList = new UI.UCObjekteList((DataContext as MainWindowViewModel).SelectedBaustelle);
|
||||||
|
uCObjekteList.ObjektSelected += UCObjekteList_ObjektSelected;
|
||||||
ContentController.Content = uCObjekteList;
|
ContentController.Content = uCObjekteList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UCObjekteList_ObjektSelected(object sender, UI.ObjektSelectEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Objekt == null) return;
|
||||||
|
(DataContext as MainWindowViewModel).SelectedObjekt = e.Objekt;
|
||||||
|
UI.UCObjektEdit uCObjektEdit = new UI.UCObjektEdit();
|
||||||
|
ContentController.Content = uCObjektEdit;
|
||||||
|
//Debugger.Break();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
20
KanSan/UI/Objekte/UCObjektEdit.xaml
Normal file
20
KanSan/UI/Objekte/UCObjektEdit.xaml
Normal 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>
|
||||||
26
KanSan/UI/Objekte/UCObjektEdit.xaml.cs
Normal file
26
KanSan/UI/Objekte/UCObjektEdit.xaml.cs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
<RowDefinition Height="50" />
|
<RowDefinition Height="50" />
|
||||||
<RowDefinition Height="50" />
|
<RowDefinition Height="50" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<TreeView Name="trvStreets" ItemsSource="{Binding KanalObjekte}">
|
<TreeView Name="trvItems" ItemsSource="{Binding KanalObjekte}" MouseDoubleClick="trvItems_MouseDoubleClick">
|
||||||
<TreeView.Resources>
|
<TreeView.Resources>
|
||||||
<HierarchicalDataTemplate DataType="{x:Type self:ObjekteTransfer}" ItemsSource="{Binding Objekte}">
|
<HierarchicalDataTemplate DataType="{x:Type self:ObjekteTransfer}" ItemsSource="{Binding Objekte}">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
@@ -31,14 +31,14 @@
|
|||||||
</HierarchicalDataTemplate>
|
</HierarchicalDataTemplate>
|
||||||
<DataTemplate DataType="{x:Type model:Sewer}">
|
<DataTemplate DataType="{x:Type model:Sewer}">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Text="Von [" />
|
<TextBlock Text="[" />
|
||||||
<TextBlock Text="{Binding PunktOben.Objektnummer}"/>
|
<TextBlock Text="{Binding PunktOben.Objektnummer}" Foreground="Blue"/>
|
||||||
<TextBlock Text="] Nach [" />
|
<TextBlock Text="] Nach [" />
|
||||||
<TextBlock Text="{Binding PunktUnten.Objektnummer}" />
|
<TextBlock Text="{Binding PunktUnten.Objektnummer}" Foreground="Blue" />
|
||||||
<TextBlock Text="] DN [" />
|
<TextBlock Text="] DN [" />
|
||||||
<TextBlock Text="{Binding DN}"/>
|
<TextBlock Text="{Binding DN}" Foreground="Blue"/>
|
||||||
<TextBlock Text="] Material ["/>
|
<TextBlock Text="] Material ["/>
|
||||||
<TextBlock Text="{Binding Material}" />
|
<TextBlock Text="{Binding Material}" Foreground="Blue" />
|
||||||
<TextBlock Text="]" />
|
<TextBlock Text="]" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using KanSan.ViewModel;
|
using KanSan.ViewModel;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
@@ -20,6 +21,7 @@ namespace KanSan.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class UCObjekteList : UserControl
|
public partial class UCObjekteList : UserControl
|
||||||
{
|
{
|
||||||
|
public event EventHandler<ObjektSelectEventArgs> ObjektSelected;
|
||||||
Baustelle baustelle;
|
Baustelle baustelle;
|
||||||
public UCObjekteList(Baustelle baustelle)
|
public UCObjekteList(Baustelle baustelle)
|
||||||
{
|
{
|
||||||
@@ -33,5 +35,27 @@ namespace KanSan.UI
|
|||||||
FrmNewObjekt frmNewObjekt = new FrmNewObjekt(baustelle);
|
FrmNewObjekt frmNewObjekt = new FrmNewObjekt(baustelle);
|
||||||
frmNewObjekt.ShowDialog();
|
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; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
66
KanSan/my_controls.xaml
Normal file
66
KanSan/my_controls.xaml
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:local="clr-namespace:KanSan">
|
||||||
|
<Style x:Key="ToggelButtonList" TargetType="{x:Type ToggleButton}">
|
||||||
|
<Setter Property="FrameworkElement.OverridesDefaultStyle" Value="True"/>
|
||||||
|
<Setter Property="FrameworkElement.FocusVisualStyle" Value="{x:Null}"/>
|
||||||
|
<Setter Property="Width" Value="170" />
|
||||||
|
<Setter Property="Height" Value="70" />
|
||||||
|
<Setter Property="Margin" Value="2" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||||
|
<Grid>
|
||||||
|
<Rectangle Name="rect" Fill="#FF808080" Stretch="Fill"/>
|
||||||
|
<ContentPresenter VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5" RecognizesAccessKey="True" TextBlock.FontFamily="Seggeo" TextBlock.FontSize="16" TextBlock.Foreground="#FFFFFFFF" TextBlock.FontWeight="Light" />
|
||||||
|
</Grid>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="UIElement.IsMouseOver" Value="True">
|
||||||
|
<Setter TargetName="rect" Property="Shape.Fill" Value="#FFFFA500" />
|
||||||
|
<Setter Property="Foreground" Value="#FFFFFFFF"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="ToggleButton.IsChecked" Value="True">
|
||||||
|
<Setter TargetName="rect" Property="Shape.Fill" Value="#FFFFA500" />
|
||||||
|
<Setter Property="Foreground" Value="#FFFFFFFF" />
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
<Style x:Key="checkBoxCircle" TargetType="{x:Type CheckBox}">
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||||
|
<Setter Property="Margin" Value="10" />
|
||||||
|
<Setter Property="Content" Value="" />
|
||||||
|
<Setter Property="IsEnabled" Value="{Binding Change}" />
|
||||||
|
<Setter Property="FrameworkElement.FocusVisualStyle" Value="{x:Null}" />
|
||||||
|
<Setter Property="Foreground" Value="#FFFFFFFF" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="{x:Type CheckBox}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="auto"/>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Ellipse Name="outerEllipse" Grid.Column="0" Width="30" Height="30" StrokeThickness="2" Stroke="#FFFFFFFF" />
|
||||||
|
<Ellipse Name="highlightCircle" Grid.Column="0" Width="20" Height="20" Fill="#FFFFFFFF"/>
|
||||||
|
<ContentPresenter Name="content" Grid.Column="1" Content="{TemplateBinding Content}" Margin="5,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
|
||||||
|
</Grid>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="ToggleButton.IsChecked" Value="True">
|
||||||
|
<Setter TargetName="highlightCircle" Property="Shape.Fill" Value="#FFFFA500"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="ToggleButton.IsChecked" Value="False">
|
||||||
|
<Setter TargetName="highlightCircle" Property="Shape.Fill" Value="#FFFFFFFF" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="UIElement.IsFocused" Value="True">
|
||||||
|
<Setter TargetName="outerEllipse" Property="Shape.Stroke" Value="#FFFFA500" />
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
Reference in New Issue
Block a user