Posts

Showing posts from August, 2020
Share:

Create Custom DockManager V1_0_0 Using DevExpress | C# | WPF | Saatody | Amit Padhiyar

In this post, I will try to create simple API structure for DockManager. Actually, The DockManager parent class will derive from DockLayoutManager (DevExpress WPF). But there, I will create simple steps to add DocumentPanel(s). And also, Create some default restrictions like FloatingMode for floating panels, DestroyOnClosingChildren for default DocumentGroup. This API is for private use only. This is version V1_0_0. And Specially created for DocumentPanel(s) restrictions and for "easy to add" features. using DevExpress.Xpf.Docking; using DevExpress.Xpf.Layout.Core; namespace Saatody.Core.UI { public class DockManager : DockLayoutManager { private LayoutGroup Root = new LayoutGroup(); private DocumentGroup DocumentGroup = new DocumentGroup(); private DocumentPanel PreviousDocumentPanel = new DocumentPanel(); public DockManager() { // Load Default Dock this.FloatingMode = FloatingMode.Desktop;

Create TreeView Using GridControl | DevExpress WPF | Saatody | Amit Padhiyar

Today i will create Advance TreeView using DevExpress GridControl Component. This code for WPF. So, It may contains XAML or Pure C# programmatically code. Actually GridControl contains many features like drag and drop, icons, adding and deleting rows. And main feature is it supports multiple columns. There can be many types of  GridControl for example TreeView, CardView, And TableView. But today, I will talk about TreeView Only. Here we needed two more class(es). These will custom class(es) as role of "Model" and "Data". The Data class contains property of GridControls or you can say simply as a columns. And, The Model class contains ObservableCollection of Data class. GridControl binding with  ObservableCollection's object using ItemsSource. See the below simple example. XAML <dxg:GridControl Name="GridControl" AutoGenerateColumns="AddNew"> <dxg:GridControl.View> <dxg:TreeListView/> </dxg:GridControl.View

What Is Meaning Of Notation E In 1.314E+1 Value? | Saatody | Amit Padhiyar

 The notation E is known as exponent in Scientific Notation. The letter E is used to mean "10 to the power of". For example, 1.314E+1  means  1.314 * 10 1   which is 13.14. A positive exponent shows that the decimal point is shifted that number of places to the right. A negative exponent shows that the decimal point is shifted that number of places to the left. Exponent Examples 1.234E+9 = 1.234 * 10 9 = 1234000000 1.234E-9 = 1.234 * 10 -9 = 0.000000001234 Even More Examples 10000 = 1 x 10 4 24327 = 2.4327 x 10 4 1000 = 1 x 10 3 7354 = 7.354 x 10 3 100 = 1 x 10 2 482 = 4.82 x 10 2 10 = 1 x 10 1 89 = 8.9 x 10 1  (not usually done) 1 = 10 0 1/10 = 0.1 = 1 x 10 - 1 0.32 = 3.2 x 10 - 1  (not usually done) 1/100 = 0.01 = 1 x 10 - 2 0.053 = 5.3 x 10 - 2 1/1000 = 0.001 = 1 x 10 - 3 0.0078 = 7.8 x 10 - 3 1/10000 = 0.0001 = 1 x 10 - 4 0.00044 = 4.4 x 10 - 4

Export FrameworkElement And Its Children As Image Such JPG Or PNG | Saatody | Amit Padhiyar

 In this post, I will show you an algorithm than can convert any FrameworkElement and its children component to PNG and JPG such image formats. Follow below algorithm as a WPF C# function. public void ExportToPng(Uri path, FrameworkElement element) { if (path == null) return; // Save current canvas transform Transform transform = element.LayoutTransform; // reset current transform (in case it is scaled or rotated) element.LayoutTransform = null; // Get the size of canvas Size size = new Size(element.Width, element.Height); // Measure and arrange the surface // VERY IMPORTANT element.Measure(size); element.Arrange(new Rect(size)); // Create a render bitmap and push the surface to it RenderTargetBitmap renderBitmap = new RenderTargetBitmap((int)size.Width, (int)size.Height, 96d, 96d, PixelFormats.Pbgra32); renderBitmap.Render(element); // Create a file stream for saving image using (System.IO.FileStream outStream = new S

Create Equal Distance Points On Path | WPF | Saatody | Amit Padhiyar

 In this post, I will show you about set points or object to path using WPF Geometry. If we use GeometryGroup then WPF able to set point on every geometry shape. For example: We take two lines and one ellipse geometry. LineGeometry LGL = new LineGeometry(); EllipseGeometry EG = new EllipseGeometry(); LineGeometry LGR = new LineGeometry(); GeometryGroup GG = new GeometryGroup(); Now we add all geometry shapes in GeometryGroup. GG.Children.Add(LGL); GG.Children.Add(EG); GG.Children.Add(LGR); Add GeometryGroup in path data. Path.Data = GG; Use below algorithm to get points. Point p; Point tg; var points = new List<Point>(); for (var i = 0; i < 100; i++) { Path.Data.GetFlattenedPathGeometry().GetPointAtFractionLength(i / 100f, out p, out tg); points.Add(p); DrawFixtures(p.X, p.Y); } DrawFixtures function is below public void DrawFixtures(double X, double Y) { Ellipse Ellipse = new Ellipse(); Ellipse.HorizontalAlignment = HorizontalAlignment.Left; Ellipse.V