Showing posts with label XBAP Appication. Show all posts
Showing posts with label XBAP Appication. Show all posts

June 6, 2011

Run XBAP Application on Google Chrome

To Execute XBAP App on Google Chrome
I Copied following dll files from Mozilla Installatio Path to Google Chrome
Mozilla Installation Path :C:\Program Files\Mozilla Firefox
Moziila Version : 3.6.17
Google Chrome Installation Path :C:\Documents and Settings\(UserName)\Local Settings\Application Data\Google\Chrome\Application
Chrome Version:11.0.696.71



js3250.dll
mozcrt19.dll
mozcpp19.dll
nspr4.dll
nss3.dll
nssutil3.dll
plc4.dll
plds4.dll
smime3.dll
sqlite3.dll
ssl3.dll
xpcom.dll
xul.dll

May 30, 2011

Code Sample for Content Template in WPF




 First of all to know how to create WPF Browser App check the below post

Below is the code to design elliptical button in WPF Application using Control Template

ExControlTemplate.xaml

<Page x:Class="TestWPF.ExControlTemplate"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="ExControlTemplate">


    <Grid>
        <Button Content=" Elliptical Button"  Width="100" Height="50" Style="{StaticResource EllipseButton}" />
          
           
        </Grid>
    


</Page>


App.xaml

<Application x:Class="TestWPF.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    StartupUri="ExControlTemplate.xaml">
    <Application.Resources>
        <Style x:Key="myStyle" TargetType="Button">
            <Setter Property="Background" Value="Orange" />
            <Setter Property="FontStyle" Value="Italic" />
            <Setter Property="Padding" Value="8,4" />
            <Setter Property="Margin" Value="4" />
        </Style>
        
        <Style x:Key="EllipseButton" TargetType="Button">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Grid>
                            
                            <Ellipse Fill="{TemplateBinding Background}"
                             Stroke="{TemplateBinding BorderBrush}"/>
                            <ContentPresenter HorizontalAlignment="Center"
                                          VerticalAlignment="Center" />
                            
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
              
                </Setter>
         
        </Style>
    </Application.Resources>
</Application>




Run the app and you 'll see the button


Controls in WPF are separated into logic, states, events ,properties and template
Template  defines the visual appearance of the control.
nThe wireup between the logic and the template is done by DataBinding.