Design geändert
This commit is contained in:
@@ -34,11 +34,17 @@
|
||||
<Compile Update="UI\Objekte\UCObjekteList.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="UI\Objekte\UCObjektEdit.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="MainWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="my_controls.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="UI\Objekte\FrmNewObjekt.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
@@ -66,5 +72,8 @@
|
||||
<Page Update="UI\Objekte\UCObjekteList.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="UI\Objekte\UCObjektEdit.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -7,6 +7,13 @@
|
||||
xmlns:syncfusion="http://schemas.syncfusion.com/wpf" x:Class="KanSan.MainWindow"
|
||||
mc:Ignorable="d"
|
||||
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.ColumnDefinitions>
|
||||
<ColumnDefinition Width="29*" />
|
||||
@@ -17,10 +24,15 @@
|
||||
<RowDefinition Height="11*" />
|
||||
</Grid.RowDefinitions>
|
||||
<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="Baustellen" Name="btnBaustellen" Click="btnBaustellen_Click" />
|
||||
<Button Content="Objekte" Name="btnObjekte" Click="btnObjekte_Click" />
|
||||
-->
|
||||
</StackPanel>
|
||||
<ContentControl Grid.Column="1" Name="ContentController" Content="KanSan"/>
|
||||
<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)
|
||||
{
|
||||
UI.UCObjekteList uCObjekteList = new UI.UCObjekteList((DataContext as MainWindowViewModel).SelectedBaustelle);
|
||||
uCObjekteList.ObjektSelected += UCObjekteList_ObjektSelected;
|
||||
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" />
|
||||
</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>
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
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