Posts

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 = n...

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

Create Simple Custom TextBox in HTML | Saatody | Amit Padhiyar

<div id="textbox" contenteditable="true">This is a paragraph. It is editable. Try to change this text.</div> <script> var textbox = document.getElementById("textbox"); textbox.addEventListener("keydown",function(event){ if(event.keyCode == 13){ var enterChar = String.fromCharCode(13); var regExp = new RegExp(enterChar,"g"); textbox.innerHTML = textbox.textContent.replace(regExp,""); } }); </script>

How to 'href' to the element even to the top margin of each div?

The following is html code I have written to store some of my favorite gradients and I wanted to link anchor to 'id="grad1"' and 'id="grad2"' even including the margin at the top. I thought the ':target:before' would work to provide the margin when those 'id's were targeted but that does not work for me somehow. When I link to the below html, it only links to the top of the content, not to the top of the margin of each div. we should add scroll-margin-top to each of your grads that is equal to the margin you apply. Example: #grad1 { margin-top: 200px; scroll-margin-top: 200px; } This way, anchors will scroll to the offset specified by the scroll-margin-top instead of the element border.