Posts

Share:

MessageBox API | WPF | C# | Saatody | Amit Padhiyar

MessageBox Class API Standard message box for normal, error, warning, and success types with some options OK, OKCancel, YesNo, YesNoCancel and some results None, Ok, Yes, No, Cancel.  Constructure  This is one and default constructor. Syntax public MessageBox() Properties Syntax public MessageBoxTypes Type {set; get;} public string Description {set; get;} public string Code {set; get;} public MessageBoxOptions Option {set; get;} public MessageBoxResults Result {set; get;} Methods System public static MessageBoxResults Show(MessageBox MessageBox) public static MessageBoxResults Show(Window Owner, string Title, MessageBoxTypes Type, string Description, string Code, MessageBoxOptions Option) public static MessageBoxResults Show(Window Owner, MessageModel Model, MessageBoxOptions Option) MessageBoxOptions enum API MessageBoxResults enum API MessageBoxTypes enum API MessageModel Class API Properties Syntax public string Title = null; public MessageTypes Type = MessageTypes.Normal; public st

DialogBox API | WPF | C# | Saatody | Amit Padhiyar

DialogBox Class API DialogBox API is providing small widget to create custom dialog box. Constructure  This is one and default constructor.  Syntax public DialogBox() Show (DialogBox DialogBox) Methods Show dialog box by calling this method. Syntax public static void Show(DialogBox DialogBox) Close (DialogBox DialogBox) Methods Close dialog box by calling this method.  Syntax public static void Close(DialogBox DialogBox) Example XAML <gui:DialogBox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Custom Box" Width="800" Height="700"> <Grid> </Grid> </gui:DialogBox>  C# using GUI = Example.Commons.GUI; namespace Example { public partial class CustomBox : GUI.DialogBox { public CustomBox() { InitializeComponent(); this.Closing += (sender, e) => {

SelectionTool in C# | WPF | Saatody | Amit Padhiyar

SelectionTool is used for array group selection like select odd values or select even values from particular numbers range. This also select groups like 2, 3, 4, 1 etc... SelectionTool Class API SelectionTool class is main class of SelectionTool. This class provides rich options to select all, deselect all, select left half, select right half, select left half from already selected values, select right half from already selected values. Add custom group selection using 'Add' button. Properties Here in SelectionTool class has only two properties. The 'Range' used to define 'from value' to 'to value'. The 'SelectedRange' gives list of selected values from 'Range' value. Syntax public Range Range public List<int> SelectedRange Constructors This is one and default constructor. Syntax public SelectionTool() Events Here only one event 'SelectedRangeChanged' which fire when selected range changed from any source. For examples: Sele

NSSlider in C# | WPF | Saatody | Amit Padhiyar

NSSlider is WPF slider's alternative. Here NS means N-North and S-South. So, NSSlider is vertical slider in WPF. In this post, I will show reference API of this UI. NSSlider Class API NSSlider has one class and this is main class. NSSlider provides Minimum, Maximum, Change, Format, Value and Caption properties with one event which is ValueChanged event. Properties Here basic commons properties with syntax is below. Syntax public decimal Minimum public decimal Maximum public decimal Change public string Format public decimal Value public string Caption  Constructors This is one and default constructor. Syntax public NSSlider() Events Here is only an event ValueChanged. This event fire when Value property value being changed. Syntax public event EventHandler ValueChanged;  Example Of NSSlider <gui:NSSlider x:Name="NS1" Minimum="-50" Maximum="20" Change="0.1" Format="00.00$" Value="5" Caption="Demo"/> NS1.

Signal Generator In C# | Saatody | Amit Padhiyar

using System; using System.Diagnostics; namespace SGDemo { /// <summary> /// Types of signal. /// </summary> public enum SignalTypes { Sine, Square, Triangle, Sawtooth } /// <summary> /// Directions of signal. /// </summary> public enum Directions { Forward, Backward } /// <summary> /// Signal generator. /// </summary> public class SignalGenerator { /// <summary> /// Shift signal on y axis. Value can be less than 0 too. /// </summary> private float offset = 0f; public float Offset { set { offset = value; } get { return offset; } } /// <summary> /// Amplitudet or height of signal. Value can be less than 0 too. /// </summary>

Color Palette In C# | WPF | Saatody | Amit Padhiyar

There are three class(es) in color palette tool. 1] ColorPalette, 2] ColorCell, 3] AddColorCell. Today, I will write reference and example about color palette. This tool is available for private use only. And the API is written in WPF C#. 1] ColorPalette Class API This is a main class of my color palette tool. This class provides functionalities for set current color, add new cell, remove exist cell, and remove all exist cells. Also has an event fire while current color change. We also set functionalities of importing and exporting ColorPalette. Properties This property stores color and also fire an event CurrentColorChanged. Syntax public Color CurrentColor Constructors This is one and default constructor. Syntax public ColorPalette() Methods These methods are used for adding and removing ColorCell from the ColorPalette. Also used for importing and exporting ColorPalette. Syntax public void AddColorCell(ColorCell ColorCell) public void RemoveColorCell(ColorCell ColorCell) public void

Async Task In C# | Async And Await Keywords | Saatody | Amit Padhiyar

Today we will discuss about async and await keyword. And will know some examples about Task. private async void MyTask() { await Task.Run(() => { // Code Here }); } Avoid use of void. use Task or Task<return_type>. private async Task MyTask() { await Task.Run(() => { // Code Here }); } It can use for non return value. private async Task<int> MyTask() { await Task.Run(() => { // Code Here }); return int; } Returns int values.