Skip to content

mahdi-ataollahi/PlateModel.Wpf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PlateModel.Wpf

17 November 2023

A vehicle license plate -as it's defined in Wikipedia- is a metal or plastic plate attached to a motor vehicle or trailer for official identification purposes. If you want to build a WPF program that shows license plates, you can use this project to demonstrate high quality license plates which are similar to the real plates.

Project structure

There are some main parts in the project:
  1. Flags
  2. Fonts
  3. Vectors
  4. Pic
  5. Plates

Flags

The flag of the countries whose plates are contained in the project are in this folder separately. The flags are created by WPF graphics so they are vectors.

Fonts

The embedded fonts that are used to make the plates similar to their real ones are copied in this folder.

Vectors

Any vector parts of the plates that are created in a separate file are copied in this folder.

Pic

Any images that are used in the plates are copied in this folder.

Plates

The plates' controls are in this folder and developers can use these controls in their projects.

The project is not limited to a specific country, and there are country categories in each part. For example I have created my country plates, Iran, in this project. If you want to create your country plates you should add your country folder in each part.

How to use plates

It's very easy to use plates in your WPF project. Just add the corresponding plate to your XAML file:

<Viewbox Width="240" xmlns:irplate="clr-namespace:IRPlateModel.Wpf.Plates.Iran;assembly=IRPlateModel.Wpf">
  <irplate:IRNationalPlate Plate="{Binding MyPlate, Mode=OneWay}" />
</Viewbox>

Note: The only way to change the size of the plate is to use a Viewbox. The most important property of each plate control is the Plate property. In the last example I bound it to MyPlate property. If you want to set it manually you should write plate's characters respectively and without any spaces, commas, etc. For example:

<irplate:IRNationalPlate Plate="12X34567" />

Plate Inputs

Plate inputs are simple textboxes decorated with some features of the corresponding plate. See this example:

<StackPanel xmlns:irplate="clr-namespace:IRPlateModel.Wpf.Plates.Iran;assembly=IRPlateModel.Wpf"
       xmlns:irplateInput="clr-namespace:IRPlateModel.Wpf.Plates.Iran.Input;assembly=IRPlateModel.Wpf">
  <irplate:IRNationalPlate Plate="{Binding Plate, ElementName=myPlateInput, Mode=OneWay}" />
  <irplateInput:IRNationalPlateInput x:Name="myPlateInput" />
</StackPanel>

What you type in the input control is shown in the plate control immediately.

About

License plate UI for cars and vehicles.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages