Code Monkey home page Code Monkey logo

kindergarten's Introduction

Pay attention: Starting from June 2017, Kindergarten is no longer an open source project.

Please contact: [email protected]


Kindergarten

What is this?

Kindergarten is information system, which provides children management for any nursery school.

Application is divided into three project

  1. Camera is simply help-app for taking photos
  2. DAL is data layer, which consists of entity models. There's also migrations there
  3. WpfApp is main program.

WpfApp

Settings save

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).

There are a few steps to add a new window:

  • 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

Example

How to open "OtherWindow" from "SomeWindow" uses Command


  • 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>

DAL

It has models and provider to database.

There's code first approach are used (Entity Framework).

Camera

This project is stand-alone app, which is not depends on the others


Update as of June 14, 2017

Kindergarten 3.0

Main Window


Child Details


Groups


Parents


Activator

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.