Xaml default background and transparent background

Sunday, November 6, 2016

Xaml  default background and transparent background This post will guide you to the internal rendering brush mechanism with interaction between elements on the element visual tree, could also be relevant to solve UI bugs on xaml code, (which are not bugs in simple meaner, only misunderstanding of the platform) 1.    While debugging an visual tree of custom control template you might find elements with Background =””. In most of cases it will not harm your application, But can also be effected in user actions. 2.    Observe this code: <Style x:Key="listItem" TargetType="{x:Type ListBoxItem}"> <Setter Property="Template"> ...
אין תגובות

UWP Win10 – introduction to page navigation.

Wednesday, September 28, 2016

The Application block of Win10 app constructed as following: Application > Window > Frame > Page While this page  can be any page you like. Commonly use pattern is leave the main page as container and inside it use internal page as Content place holder. Lets build the solution files than continue on navigation implementation. I simply create solution folder named Pages with some pages inside, Now lets build the MainPage xaml: <Grid Background="LightCyan"> <Grid.RowDefinitions> <RowDefinition Height="1*"/> ...
אין תגובות

UWP new Controls – Layout controls

Sunday, September 11, 2016

In this post I will passing over some major layout technics for developers who moving forward to UWP environment. This migration from former Windows versions required a short introduction and that my posts about. In for this time: Layout controls Pivot-Control: Actually its not new, just replacement to the traditional tab control, with nicer behavior and looks Code: <Pivot Title="My Pivtos"> <PivotItem Header="Pivot Item 1"> <Page> ...
אין תגובות

From WPF to UWP – New controls

Monday, August 29, 2016

For those who familiars with WPF this post is special for you while merging WPF skills with upcoming UWP skills , I am not gonna talk about layout here only spotting for some new features that I found nice to use. Flyout- this new Control can gardening almost anywhere to provide extra information like tooltips or even takes  traditional Dialog places. Flyout Demo: <Button Width="100" Content="Hello Button" > <Button.Flyout> <Flyout Placement="Full"> ...
אין תגובות

UWP-Win10- Working with Adaptive triggers

Thursday, August 4, 2016

One of the new features while developing for Universal Apps is Adaptive UI, Having thinking of cross devices, we should never build a fixed UI, consider big PC Laptops, Tablets or even smartphone, It is very easy actually, just register to main window size changed and manage the layout state according to current MainWindow size -* First observe the next image: in general this is a wide screen state. Than observe that image: In general it is a narrow state. So, what we have here is a simple technic which required some practices to make the best from it, The UI content is simple: <RelativePanel> ...
אין תגובות

TemplateBinding and TemplateParent Digging

Monday, May 9, 2016

One of the things that can completely freak you out. Lets start with facts: 1.  While customize an application you might use something like this: <TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent},Path=MyProperty}"/> Or maybe this: <TextBlock Text="{TemplateBinding MyProperty}" /> While this is on the ResourceDictionary of your app and about to styling your custom control, and MyProperty is an DependencyProperty on the logic part of the Control so what the different between those two?  And what the default choose should be? By the way while most of programmers used to write You can use the Short way as: Text="{Binding TemplatedParent.MyProperty2}" 2.    A full demonstration will be like  this one: public class CustomControl1 : Control ...
אין תגובות

Customize Window header Style

Thursday, March 10, 2016

In case you demand some extras from your MainWindow as programs like Microsoft Office did, Lets say extra icons, menus , buttons or whatever. The built in Window of System.Window type and its API in Xaml is very uncomfortable for customization and guess what , you the one who need to do all the dirty work. All of it? well I gonna help you to how to start. In this screen shot I have, 1 . Icon on left (standard) 2. App name at left (standard) 3.  details on center (extra) 4. app special menu at right (extra) 5. window buttons at left (kind of standard) So, first...
אין תגובות

Follow Xaml code Order or don’t be there

Monday, December 7, 2015

Sometimes you surprised from tiny things around you day who might taking you out of control. For example the Order of the Xaml elements on your sheet. The famous one is probably using a source who defined later, like: <DataTemplate x:Key="dt1"> <Grid> <Button Style="{StaticResource style2}" /> </Grid> </DataTemplate> <Style TargetType="Button" x:Key="style2"> In this case there is some...
אין תגובות

Attached Property – select all text

Tuesday, October 27, 2015

in TextBox control double clicking on Text should select all inner text? Well isn't? not for case the text itself is a complex one, like real number like : 23.34 In that case , it will select but only the part you on it, at least by default What we need now is activate the TextBoxBase.Selectall function but using WPF tools and supporting MVVM architecture. The simple solution will be Attached Property or Behavior , I think that Behavior should kept for complex problems when we do need a reference per control instance , and here a simple static property should be enough. There for...
אין תגובות

WPF Custom Controls – toggle buttons with Group

Sunday, October 4, 2015

The idea is quite simple , create header of ListBox who combine two types of contents, to be acting like an tab control , meaning filtering the Listbox content, and So , for implementation we can considerate a few options, Tabcontrol , RadioButtons , Toggle Button etc.. Just for the fun I have made it with toggles, the truth is I where must use them because of look an fill demands and styling but this is not the point, The point is what between RadioButton control and ToggleButton control, the main issue is the group who might surround the radio buttons and auto switch...
אין תגובות