Skip to main content

Posts

Showing posts with the label Csharp

Adding Background Images In Windows Phone Application

Solution 1 : You can set the Background property of this Grid control to an ImageBrush. <Grid.Background> </Grid.Background> Solution 2 : Set Grid.Background property in the LayoutRootStyle. Instead of setting the Grid.Background property in each page you can also set it once in the 'LayoutRootStyle' style. The All my pages have this style set on the root Grid control. This style is defined in the 'StandardStyles.xaml' which can be found in the 'Common' folder. The 'Background' property of the style is set to the 'ApplicationPageBackgroundThemeBrush' static resource which makes it black. You have to replace it with the ImageBrush. <Style x:Key="LayoutRootStyle" TargetType="Panel"> </Setter>

Adding Controls in Windows Phone - Add Button, TextView ..etc

Go to View --> ToolBox --> And you can add any controls.Or else you can add a bit of code as below. <Button Content="Click Me" HorizontalAlignment="Left" Margin="138,161,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.617,1.507" Height="117" Width="190" Click="Button_Click_1"/> Then to add click action for controls you can just double click the controls and you may navigate to xaml.cs page where you can add your code. namespace AddControls { public partial class MainPage : PhoneApplicationPage { // Constructor public MainPage() { InitializeComponent(); // Sample code to localize the ApplicationBar //BuildLocalizedApplicationBar(); } private void Button_Click_1(object sender, RoutedEventArgs e) { Console.WriteLine("Iam being Clicked......")...