ObjekteListe angefangen
This commit is contained in:
@@ -7,6 +7,9 @@
|
||||
</ApplicationDefinition>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="UI\Objekte\FrmNewObjekt.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="UI\Kunde\UCKundeList.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
@@ -28,11 +31,17 @@
|
||||
<Compile Update="UI\Baustelle\UCBaustelleList.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="UI\Objekte\UCObjekteList.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="MainWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="UI\Objekte\FrmNewObjekt.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="UI\Kunde\UCKundeList.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
@@ -54,5 +63,8 @@
|
||||
<Page Update="UI\Baustelle\UCBaustelleList.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="UI\Objekte\UCObjekteList.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -20,7 +20,7 @@
|
||||
<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" />
|
||||
<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">
|
||||
|
||||
@@ -127,6 +127,12 @@ namespace KanSan
|
||||
uBaustelleEdit.SpeichernClicked += Edit_SpeichernClicked;
|
||||
ContentController.Content = uBaustelleEdit;
|
||||
}
|
||||
|
||||
private void btnObjekte_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
UI.UCObjekteList uCObjekteList = new UI.UCObjekteList((DataContext as MainWindowViewModel).SelectedBaustelle);
|
||||
ContentController.Content = uCObjekteList;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
32
KanSan/SampleData/ObjekteListViewModelSampleData.cs
Normal file
32
KanSan/SampleData/ObjekteListViewModelSampleData.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using KanSan.Base.Interfaces.UI;
|
||||
using KanSan.Base.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace KanSan.SampleData
|
||||
{
|
||||
class ObjekteListViewModelSampleData
|
||||
{
|
||||
List<Sewer> kanalObjekte = new List<Sewer>();
|
||||
public List<Sewer> KanalObjekte => kanalObjekte;
|
||||
|
||||
BaustelleListViewModelSampleData baustellen = new BaustelleListViewModelSampleData();
|
||||
|
||||
public ObjekteListViewModelSampleData()
|
||||
{
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
kanalObjekte.Add(new Sewer()
|
||||
{
|
||||
Material = Base.Enums.EMaterial.Steinzeug,
|
||||
Baustelle = baustellen.Baustellen[0],
|
||||
ObjektNummer = i.ToString(),
|
||||
StrasseName = "Grambergstrasse",
|
||||
DN = 150
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
28
KanSan/UI/Objekte/FrmNewObjekt.xaml
Normal file
28
KanSan/UI/Objekte/FrmNewObjekt.xaml
Normal file
@@ -0,0 +1,28 @@
|
||||
<Window x:Class="KanSan.UI.FrmNewObjekt"
|
||||
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:local="clr-namespace:KanSan.UI"
|
||||
mc:Ignorable="d"
|
||||
Title="FrmNewObjekt" Height="450" Width="800">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Button Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" Content="Speichern" Name="Speichern" Click="Speichern_Click" />
|
||||
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Text="{Binding PunktOben}" />
|
||||
<TextBox Grid.Column="1" Grid.Row="2" Text="{Binding PunktUnten}" />
|
||||
<TextBox Grid.Column="1" Grid.Row="3" Text="{Binding Strasse}" />
|
||||
<TextBox Grid.Column="1" Grid.Row="4" Text="{Binding DN}" />
|
||||
</Grid>
|
||||
</Window>
|
||||
34
KanSan/UI/Objekte/FrmNewObjekt.xaml.cs
Normal file
34
KanSan/UI/Objekte/FrmNewObjekt.xaml.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using KanSan.Base.Models;
|
||||
using KanSan.ViewModel.Objekte;
|
||||
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.Shapes;
|
||||
|
||||
namespace KanSan.UI
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für FrmNewObjekt.xaml
|
||||
/// </summary>
|
||||
public partial class FrmNewObjekt : Window
|
||||
{
|
||||
public FrmNewObjekt(Baustelle baustelle)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new ObjekteAddViewModel(baustelle);
|
||||
}
|
||||
|
||||
private void Speichern_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
(DataContext as ObjekteAddViewModel).Hinzufügen();
|
||||
}
|
||||
}
|
||||
}
|
||||
37
KanSan/UI/Objekte/UCObjekteList.xaml
Normal file
37
KanSan/UI/Objekte/UCObjekteList.xaml
Normal file
@@ -0,0 +1,37 @@
|
||||
<UserControl x:Class="KanSan.UI.UCObjekteList"
|
||||
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"
|
||||
xmlns:sd ="clr-namespace:KanSan.SampleData"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="1024" d:DesignWidth="5000">
|
||||
<d:UserControl.DataContext>
|
||||
<sd:ObjekteListViewModelSampleData />
|
||||
</d:UserControl.DataContext>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="50" />
|
||||
</Grid.RowDefinitions>
|
||||
<TreeView ItemsSource="{Binding KanalObjekte}">
|
||||
|
||||
</TreeView>
|
||||
<!--<DataGrid ItemsSource="{Binding KanalObjekte}" Name="dgObjekte" AutoGenerateColumns="False">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Strasse" Binding="{Binding StrasseName}" />
|
||||
<DataGridTextColumn Header="Objektnummer" Binding="{Binding ObjektNummer}" />
|
||||
<DataGridTextColumn Header="Durchmesser" Binding="{Binding DN}" />
|
||||
<DataGridTextColumn Header="Material" Binding="{Binding Material}" />
|
||||
</DataGrid.Columns>
|
||||
|
||||
</DataGrid>-->
|
||||
<Button Grid.Row="1" x:Name="ProjektSelect" Content="Objekt Auswählen" />
|
||||
<Button Grid.Row="2" Name="ProjektEdit" Content="Objekt Editieren" />
|
||||
<Button Grid.Row="3" Name="ObjektNew" Content="Neue Objekt Hinzufügen" Click="ObjektNew_Click" />
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
37
KanSan/UI/Objekte/UCObjekteList.xaml.cs
Normal file
37
KanSan/UI/Objekte/UCObjekteList.xaml.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using KanSan.Base.Models;
|
||||
using KanSan.ViewModel;
|
||||
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 UCObjekteList.xaml
|
||||
/// </summary>
|
||||
public partial class UCObjekteList : UserControl
|
||||
{
|
||||
Baustelle baustelle;
|
||||
public UCObjekteList(Baustelle baustelle)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.baustelle = baustelle;
|
||||
this.DataContext = new ObjekteListViewModel(baustelle);
|
||||
}
|
||||
|
||||
private void ObjektNew_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
FrmNewObjekt frmNewObjekt = new FrmNewObjekt(baustelle);
|
||||
frmNewObjekt.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user