Please contact: kofon95@mail.ru
Kindergarten is information system, which provides children management for any nursery school.
Application is divided into three project
- Camera is simply help-app for taking photos
- DAL is data layer, which consists of entity models. There's also migrations there
- WpfApp is main program.
Window resolution and state (besides minimize) always save in settings.json.
You can save some settings using binding to [] with default value.
For example
<TextBox Text="{Binding '[font_size_tables, 12]'}" />
where "12" is default value
Settings load when program has started and save when it has shut down (see App.xaml.cs).
- to add new *.xaml into the View directory
- to add class into the ViewModel (namespace) directory
- to derive created view model from ViewModelBase or PipeViewModel classes
- in the App.xaml to add <ViewViewModelPair> into <ViewViewModelPairs> as child
- SomeViewModel.cs
public class SomeViewModel : ViewModelBase
{
public IRelayCommand OpenOtherCommand { get; }
public SomeViewModel()
{
AddChildCommand = new RelayCommand<string>(OpenOther);
}
public void OpenOther(string data)
{
// parameters
var pipe = new Pipe(isDialog: true);
pipe.SetParameter("the_first_argument", 1);
pipe.SetParameter("the_second_argument", data);
StartViewModel<OtherViewModel>(pipe);
}
}
- OtherViewModel.cs
public class OtherViewModel : ViewModelBase
{
public override void OnLoaded()
{
int arg1 = (int) Pipe.GetParameter("the_first_argument");
string arg2 = (string) Pipe.GetParameter("the_second_argument");
string arg3 = Pipe.GetParameter("no argument", "this will be a default value"); // no cast
MessageBox.Show($"Parameters: arg1 = {arg1}, arg2 = {arg2}, arg3 = {arg3}", "Title");
}
public override bool OnFinishing()
{
if (MessageBox.Show("Are you sure?", "Exit", MessageBoxButton.YesNo) != MessageBoxResult.Yes)
return false; // false - cancel exit
}
}
- SomeWindow.xaml
<Window x:Class="WpfApp.View.SomeWindow"
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"
mc:Ignorable="d"
Title="SomeWindow" Height="300" Width="300">
<StackPanel>
<TextBox Name="TextBox" Text="This is parameter for other window"/>
<Button Content="Open other window" Command="{Binding OpenOtherCommand}" CommandParameter="{Binding ElementName=TextBox, Path=Text}"/>
</StackPanel>
</Window>
It has models and provider to database.
There's code first approach are used (Entity Framework).
This project is stand-alone app, which is not depends on the others
Main Window
Child Details
Groups
Parents
Activator