windows store app xaml C# code with styles for left colored panel with vertical text and header with left, center and right alignment textblocks
Xaml code for left panel with vertical text, header with multiple textblocks with different alignments
<Page
x:Class="App1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App1"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Page.Resources>
<Style x:Key="LeftPanelStyle" TargetType="Grid" >
<Setter Property="Background" Value="Green"/>
</Style>
<ImageBrush x:Key="BackgroundBrush"
ImageSource="ms-appx:///Assets/bg.png"
Stretch="UniformToFill" />
<Style x:Key="LayoutRootStyle" TargetType="Panel">
<Setter Property="Background" Value="{StaticResource BackgroundBrush}"/>
<Setter Property="ChildrenTransitions">
<Setter.Value>
<TransitionCollection>
<EntranceThemeTransition/>
</TransitionCollection>
</Setter.Value>
</Setter>
</Style>
</Page.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="56"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid Style="{StaticResource LeftPanelStyle}">
<Grid.RowDefinitions>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Button x:Name="backButton" Margin="39,59,39,0" Command="{Binding NavigationHelper.GoBackCommand, ElementName=pageRoot}"
Style="{StaticResource NavigationBackButtonNormalStyle}"
VerticalAlignment="Top"
AutomationProperties.Name="Back"
AutomationProperties.AutomationId="BackButton"
AutomationProperties.ItemType="Navigation Button"/>
<StackPanel Grid.Row="1" Grid.Column="0" VerticalAlignment="Bottom" Margin="0,0,0,0">
<StackPanel.RenderTransform>
<CompositeTransform Rotation="-90"></CompositeTransform>
</StackPanel.RenderTransform>
<TextBlock Text="Side Heading" FontSize="22" Margin="0,15,-226,0" />
</StackPanel>
</Grid>
<Grid Grid.Column="1" Style="{StaticResource LayoutRootStyle}">
<Grid.RowDefinitions>
<RowDefinition Height="120" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Back button and page title -->
<Grid Grid.Column="1" VerticalAlignment="Top" Margin="0,15,0,0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="170"/>
<ColumnDefinition Width="60"/>
</Grid.ColumnDefinitions>
<Image Grid.Column="1" VerticalAlignment="Bottom" Grid.RowSpan="2" Grid.Row="0" Height="56" Width="114" Source="{Binding SelectedEventLogo}" Stretch="None" HorizontalAlignment="Left">
</Image>
<StackPanel Grid.Column="2" Grid.Row="0">
<TextBlock Text="Page Header" Style="{StaticResource HeaderTextBlockStyle}"/>
</StackPanel>
<StackPanel Grid.Column="3" Grid.Row="0" HorizontalAlignment="Center">
<TextBlock Text="2nd" Grid.Column="1" IsHitTestVisible="false" Style="{StaticResource HeaderTextBlockStyle}" />
</StackPanel>
<StackPanel Grid.Column="5" Grid.Row="0" HorizontalAlignment="Right">
<TextBlock Text="3rd" Grid.Column="1" IsHitTestVisible="false" Style="{StaticResource HeaderTextBlockStyle}" HorizontalAlignment="Right" />
</StackPanel>
</Grid>
</Grid>
</Grid>
</Page>
<Page
x:Class="App1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App1"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Page.Resources>
<Style x:Key="LeftPanelStyle" TargetType="Grid" >
<Setter Property="Background" Value="Green"/>
</Style>
<ImageBrush x:Key="BackgroundBrush"
ImageSource="ms-appx:///Assets/bg.png"
Stretch="UniformToFill" />
<Style x:Key="LayoutRootStyle" TargetType="Panel">
<Setter Property="Background" Value="{StaticResource BackgroundBrush}"/>
<Setter Property="ChildrenTransitions">
<Setter.Value>
<TransitionCollection>
<EntranceThemeTransition/>
</TransitionCollection>
</Setter.Value>
</Setter>
</Style>
</Page.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="56"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid Style="{StaticResource LeftPanelStyle}">
<Grid.RowDefinitions>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Button x:Name="backButton" Margin="39,59,39,0" Command="{Binding NavigationHelper.GoBackCommand, ElementName=pageRoot}"
Style="{StaticResource NavigationBackButtonNormalStyle}"
VerticalAlignment="Top"
AutomationProperties.Name="Back"
AutomationProperties.AutomationId="BackButton"
AutomationProperties.ItemType="Navigation Button"/>
<StackPanel Grid.Row="1" Grid.Column="0" VerticalAlignment="Bottom" Margin="0,0,0,0">
<StackPanel.RenderTransform>
<CompositeTransform Rotation="-90"></CompositeTransform>
</StackPanel.RenderTransform>
<TextBlock Text="Side Heading" FontSize="22" Margin="0,15,-226,0" />
</StackPanel>
</Grid>
<Grid Grid.Column="1" Style="{StaticResource LayoutRootStyle}">
<Grid.RowDefinitions>
<RowDefinition Height="120" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- Back button and page title -->
<Grid Grid.Column="1" VerticalAlignment="Top" Margin="0,15,0,0" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="150"/>
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="170"/>
<ColumnDefinition Width="60"/>
</Grid.ColumnDefinitions>
<Image Grid.Column="1" VerticalAlignment="Bottom" Grid.RowSpan="2" Grid.Row="0" Height="56" Width="114" Source="{Binding SelectedEventLogo}" Stretch="None" HorizontalAlignment="Left">
</Image>
<StackPanel Grid.Column="2" Grid.Row="0">
<TextBlock Text="Page Header" Style="{StaticResource HeaderTextBlockStyle}"/>
</StackPanel>
<StackPanel Grid.Column="3" Grid.Row="0" HorizontalAlignment="Center">
<TextBlock Text="2nd" Grid.Column="1" IsHitTestVisible="false" Style="{StaticResource HeaderTextBlockStyle}" />
</StackPanel>
<StackPanel Grid.Column="5" Grid.Row="0" HorizontalAlignment="Right">
<TextBlock Text="3rd" Grid.Column="1" IsHitTestVisible="false" Style="{StaticResource HeaderTextBlockStyle}" HorizontalAlignment="Right" />
</StackPanel>
</Grid>
</Grid>
</Grid>
</Page>
how to wrap windows store app xaml button content or text
There is no wrapping property available for button content so if you want to have wrapping content inside button use textblock control inside button control. Then apply wrapping for textblock text as shown in the below xaml code.
XAML Code to wrap content inside a xaml button control used for wpf and windows store apps
<Button Height="190" Width="296">
<TextBlock TextWrapping="Wrap" TextAlignment="Center">Content to be wrapped inside button goes here</TextBlock>
</Button>
XAML Code to wrap content inside a xaml button control used for wpf and windows store apps
<Button Height="190" Width="296">
<TextBlock TextWrapping="Wrap" TextAlignment="Center">Content to be wrapped inside button goes here</TextBlock>
</Button>
Windows store apps XAML C# Using common image as background image in all pages
Code in resource dictionary to mention an image as source to use in all pages as background image
<!--Background image for all pages-->
<ImageBrush x:Key="BgImage" ImageSource="Images/InnerBg.png"></ImageBrush>
<!--Background image for all pages-->
<ImageBrush x:Key="BgImage" ImageSource="Images/InnerBg.png"></ImageBrush>
Code in xaml page to add it as background image
<Grid x:Name="MainGrid" Background="{StaticResource BgImage}">
</Grid>
windows store apps xaml global app bar button styles in resource dictionary with custom image
This code is used to add an app bar in a xaml page.
That app contains 3 buttons.
Appbar button inside secondary commands tag are known as global commands and are displayed on the right side of the appbar.
For this three buttons styles are written in sepearate resource dictionary file.
label property is used to give the name below the appbar button and icon is used to mention the image icon to be displayed in the appbar button.
3 rd button style contains content template with image source to display custom image in appbar button.
To use global style written in seperate resourcedictionary page in every page of your application you have to include the below xaml tags in app.xaml page.
Code in App.xaml page
<Application
x:Class="BSNFRailway.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:BSNFRailway">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="BSNFResources.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
XAML Code for app bar in MainPage.xaml
<Page.BottomAppBar>
<CommandBar>
<AppBarButton Style="{StaticResource AppBarRefreshButtonStyle}" />
<CommandBar.SecondaryCommands>
<AppBarButton Style="{StaticResource AppBarFilterButtonStyle}" />
<AppBarButton Label="Asset Tree" Style="{StaticResource AppBarAssetTreeButtonStyle}" >
</AppBarButton>
</CommandBar.SecondaryCommands>
</CommandBar>
</Page.BottomAppBar>
Code in ResourceDictionary.xaml page
<Style x:Key="AppBarFilterButtonStyle" TargetType="AppBarButton" >
<Setter Property="Label" Value="Filter" ></Setter>
<Setter Property="Icon" Value="Filter" ></Setter>
</Style>
<Style x:Key="AppBarRefreshButtonStyle" TargetType="AppBarButton" >
<Setter Property="Label" Value="Refresh" ></Setter>
<Setter Property="Icon" Value="Refresh" ></Setter>
</Style>
<Style x:Key="AppBarAssetTreeButtonStyle" TargetType="AppBarButton">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<Image Source="/Images/TreeLogo.png" />
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="Label" Value="Tree" />
</Style>
That app contains 3 buttons.
Appbar button inside secondary commands tag are known as global commands and are displayed on the right side of the appbar.
For this three buttons styles are written in sepearate resource dictionary file.
label property is used to give the name below the appbar button and icon is used to mention the image icon to be displayed in the appbar button.
3 rd button style contains content template with image source to display custom image in appbar button.
To use global style written in seperate resourcedictionary page in every page of your application you have to include the below xaml tags in app.xaml page.
Code in App.xaml page
<Application
x:Class="BSNFRailway.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:BSNFRailway">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="BSNFResources.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
XAML Code for app bar in MainPage.xaml
<Page.BottomAppBar>
<CommandBar>
<AppBarButton Style="{StaticResource AppBarRefreshButtonStyle}" />
<CommandBar.SecondaryCommands>
<AppBarButton Style="{StaticResource AppBarFilterButtonStyle}" />
<AppBarButton Label="Asset Tree" Style="{StaticResource AppBarAssetTreeButtonStyle}" >
</AppBarButton>
</CommandBar.SecondaryCommands>
</CommandBar>
</Page.BottomAppBar>
Code in ResourceDictionary.xaml page
<Style x:Key="AppBarFilterButtonStyle" TargetType="AppBarButton" >
<Setter Property="Label" Value="Filter" ></Setter>
<Setter Property="Icon" Value="Filter" ></Setter>
</Style>
<Style x:Key="AppBarRefreshButtonStyle" TargetType="AppBarButton" >
<Setter Property="Label" Value="Refresh" ></Setter>
<Setter Property="Icon" Value="Refresh" ></Setter>
</Style>
<Style x:Key="AppBarAssetTreeButtonStyle" TargetType="AppBarButton">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<Image Source="/Images/TreeLogo.png" />
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="Label" Value="Tree" />
</Style>
Visual Studio TFS ( Team Foundation Server )
In TFS
we can see My Work in which you can find different categories like
In Progress Work
Suspended Work
Available Work Items
Code Reviews
--------
Open Query in Available Work Items is used to view work.
To assign task to team mates
In Available work items - New - Task - enter details of task and assign task to you - Save it and refresh My Work in TFS to see the newly added task under available work items.
we can see My Work in which you can find different categories like
In Progress Work
Suspended Work
Available Work Items
Code Reviews
--------
Open Query in Available Work Items is used to view work.
To assign task to team mates
In Available work items - New - Task - enter details of task and assign task to you - Save it and refresh My Work in TFS to see the newly added task under available work items.
what is XAMARIN
XAMARIN enable developers to create native ios, android and other mobile apps using C#.NET.
It gives native user interface, native performance, shared code across platforms to every moblie platform using C#.NET.
You can also use VB.NET bussiness and data logic code.
https://xamarin.com/ - Official website to download free trial of templates to use in Visual studio to create apps.
Approaches to create native apps without XAMARIN
XCode with Objective C for IOS App, Eclipse with Java for Android App, Visual Studio with C#.NET for Windows app.
Write once, run anywhere approach with browser fragmentation is like executing app on browser which is not equal to native app.
XAMARIN's Unique approach
It gives native user interface, native performance, shared code across platforms to every moblie platform using C#.NET.
C#.NET is Awesome we have excellent features like LINQ support, Work with XML easily XDocument, Event handling and delegates.
Link for XAMARIN documents
http://docs.xamarin.com/guides/cross-platform/getting_started/beginning_a_xamarin_trial/
Link for C#.NET tutorial
http://www.dbakings.com/CSharp/Default.aspx
XAMARIN APIs are always up to date with the latest APIs.
New Features in MS Visual Studio 2013
You can change the theme of visual studio and you can also create you own custom theme for your visual studio.
Roaming settings can be saved and applied to your visual studio by signing in using live account.
shortcut to organize code
alt + up arrow will take your code one line above
alt + down arrow will take your code one line down
you can use the search textbox at the top of visual studio to search for the options in tools to change ide options.
flag button is used to show the notifications about the updates.
you can use an option - don't copy blank text so that ctrl+c will not work if you select no text.
you can the change the selected text color in code editing window.
on the right side you can see the yellow bar which displays all the unsaved code in your code window to check easily by displaying code on mouse hover
ctrl + k + d to arrange the code in order.
Now you can do something while your build is running.
f12 will take you to the definition ie., go to definition and alt+f12 will display the definition right in the location where you have method name.
ctrl+i is for incremental search which is used to search when you are typing the chars in search box.
In console application output screen right click on the icon to go to properties where you can change the colors, fonts and lot more.
If your cursor is inside the parenthesis you can press tab key to come out of one brace at a time.
ctrl + k + c to comment
ctrl + k + u to uncomment
Roaming settings can be saved and applied to your visual studio by signing in using live account.
shortcut to organize code
alt + up arrow will take your code one line above
alt + down arrow will take your code one line down
you can use the search textbox at the top of visual studio to search for the options in tools to change ide options.
flag button is used to show the notifications about the updates.
you can use an option - don't copy blank text so that ctrl+c will not work if you select no text.
you can the change the selected text color in code editing window.
on the right side you can see the yellow bar which displays all the unsaved code in your code window to check easily by displaying code on mouse hover
ctrl + k + d to arrange the code in order.
Now you can do something while your build is running.
f12 will take you to the definition ie., go to definition and alt+f12 will display the definition right in the location where you have method name.
ctrl+i is for incremental search which is used to search when you are typing the chars in search box.
In console application output screen right click on the icon to go to properties where you can change the colors, fonts and lot more.
If your cursor is inside the parenthesis you can press tab key to come out of one brace at a time.
ctrl + k + c to comment
ctrl + k + u to uncomment
