Pages

Tuesday, 22 February 2011

grid with checkbox column in silverlight

 /////////////xaml code./////////////////////////////////
<data:DataGrid x:Name="dgPerson" Margin="8" IsReadOnly="True" 
                   LoadingRow="dgPerson_LoadingRow"  AutoGenerateColumns="False" Width="425" >
                            <data:DataGrid.Columns>
                                <data:DataGridTemplateColumn Width="80" >
                                    <data:DataGridTemplateColumn.CellTemplate>
                                        <DataTemplate>
                                            <CheckBox x:Name="chkPerson" Click="chkPerson_Click"
                                      VerticalAlignment="Center" IsChecked="false" HorizontalAlignment="Center" HorizontalContentAlignment="Center"/>
                                        </DataTemplate>
                                    </data:DataGridTemplateColumn.CellTemplate>
                                </data:DataGridTemplateColumn>
                                <data:DataGridTextColumn Header="Fee Type" Binding="{Binding Residualfee}" MinWidth="120" Width="SizeToCells" CanUserReorder="True" CanUserSort="True"/>
                                <data:DataGridTemplateColumn Width="80" Header="Fee" >
                                    <data:DataGridTemplateColumn.CellTemplate>
                                        <DataTemplate>
                                            <TextBox Width="120" Height="30" Name="feeamount"  Text="{Binding FeeAmount,Mode=TwoWay}"
                                                     ></TextBox>
                                        </DataTemplate>
                                    </data:DataGridTemplateColumn.CellTemplate>
                                </data:DataGridTemplateColumn>
                            </data:DataGrid.Columns>
                        </data:DataGrid>
                        <data:DataPager x:Name="dataPager1" Width="425" Margin="0,-10,0,0"
                                    Source="{Binding Path=ItemsSource,ElementName=dgPerson}"
                        PageSize="2"    DisplayMode="FirstLastPreviousNext" ></data:DataPager>

//////////////////////////public var////////////////////
 //List for Original List of Facilitie
        ObservableCollection<AssignFecilitieToProvision> myList;

        //List for selected Facilitie
        ObservableCollection<AssignFecilitieToProvision> personList = new ObservableCollection<AssignFecilitieToProvision>();
////////////////////////////////chk _clik////////////////////
 CheckBox chk = sender as CheckBox;

            bool check = chk.IsChecked.Value;
            var obj = dgPerson.SelectedItem as AssignFecilitieToProvision;
           
            Facilitie p = chk.DataContext as Facilitie;
            if (check)
            {
                if (!personList.Contains(obj))
                    personList.Add(obj);

            }
            else
            {
                personList.Remove(obj);
            }
////////////////save button////////////
foreach (var item in personList)
            {
///////////do insert
}

Friday, 18 February 2011

Telerik radgridview in silverlight

 xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"

<telerik:RadGridView x:Name="RadGridView1" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" Loaded="RadGridView1_Loaded" AutoGenerateColumns="False" RowDetailsVisibilityMode="VisibleWhenSelected" CanUserFreezeColumns="False">
                            <telerik:RadGridView.Columns>
                                <!--<telerik:GridViewDataColumn Header="Sl No" DataMemberBinding="{Binding Slno}" />-->
                                <!--<telerik:GridViewComboBoxColumn Header="Provision Name" Width="200"
                                   DataMemberBinding="{Binding Provision, Mode=TwoWay}"
                                   UniqueName="Provision"
                                   ItemsSourceBinding="{Binding Provision}"
                                   SelectedValueMemberPath="ProvisionId"
                                                               
                                   DisplayMemberPath="Provision" x:Name="CMBProvision">
                                   
                                </telerik:GridViewComboBoxColumn>

                                <telerik:GridViewComboBoxColumn x:Name="CMBResidual" Header="ResidualFee Name" Width="200"
                                  DataMemberBinding="{Binding Residualfee, Mode=TwoWay}"
                                   UniqueName="Residualfee"
                                   ItemsSourceBinding="{Binding Residualfee}"
                                   SelectedValueMemberPath="ResidualfeeId"
                                   DisplayMemberPath="Residualfee" >

                                </telerik:GridViewComboBoxColumn>-->
                                <telerik:GridViewDataColumn Header="Provision Name" Width="200" DataMemberBinding="{Binding Provision, Mode=TwoWay}" >
                                    <telerik:GridViewDataColumn.CellTemplate>
                                        <DataTemplate>
                                            <TextBlock Text="{Binding Provision}" />
                                        </DataTemplate>
                                    </telerik:GridViewDataColumn.CellTemplate>
                                    <telerik:GridViewDataColumn.CellEditTemplate>
                                        <DataTemplate>
                                            <TextBox x:Name="TxtProvisionnames" Text="{Binding Provision}" SelectionChanged="TxtProvisionnames_SelectionChanged"></TextBox>
                                        </DataTemplate>
                                    </telerik:GridViewDataColumn.CellEditTemplate>


                                </telerik:GridViewDataColumn>


                                <telerik:GridViewDataColumn Header="ResidualFee Name" Width="200" DataMemberBinding="{Binding Residualfee, Mode=TwoWay}" >
                                    <telerik:GridViewDataColumn.CellTemplate>
                                        <DataTemplate>
                                            <TextBlock Text="{Binding Residualfee}" />
                                        </DataTemplate>
                                    </telerik:GridViewDataColumn.CellTemplate>
                                    <telerik:GridViewDataColumn.CellEditTemplate>
                                        <DataTemplate>
                                            <TextBox x:Name="TxtResidualfeenames" Text="{Binding Residualfee}" SelectionChanged="TxtResidualfeenames_SelectionChanged"></TextBox>
                                        </DataTemplate>
                                    </telerik:GridViewDataColumn.CellEditTemplate>


                                </telerik:GridViewDataColumn>
                                <!--<telerik:GridViewColumn Width="150">
                                    <telerik:GridViewColumn.CellTemplate>
                                        <DataTemplate x:Name="dtupdate">
                                          
                                            <HyperlinkButton x:Name="BtnUpdates" Content="Update" Tag="{Binding Slno}"
                                                FontWeight="Normal" Click="BtnUpdates_Click"></HyperlinkButton>
                                        </DataTemplate>
                                    </telerik:GridViewColumn.CellTemplate>
                                </telerik:GridViewColumn>-->



                                <telerik:GridViewColumn Width="150">
                                    <telerik:GridViewColumn.CellTemplate>
                                        <DataTemplate x:Name="dtDelete">
                                            <!--<telerik:RadButton Content="Update" Width="80" Height="30" Name="BtnUpdates" Click="BtnUpdates_Click"></telerik:RadButton>-->
                                            <HyperlinkButton x:Name="hypDelete" Content="Delete" Tag="{Binding Slno}"
                                                FontWeight="Normal" Click="hypDelete_Click"></HyperlinkButton>
                                        </DataTemplate>
                                    </telerik:GridViewColumn.CellTemplate>
                                </telerik:GridViewColumn>

                            </telerik:RadGridView.Columns>

                        </telerik:RadGridView>
                        <sdk:DataPager x:Name="dataPager"
                                    Source="{Binding Path=ItemsSource,ElementName=RadGridView1}"
                        PageSize="6"    DisplayMode="FirstLastPreviousNext" ></sdk:DataPager>

Wednesday, 9 February 2011

applying styles for ag menus in silverlight

    <ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:dxm="clr-namespace:DevExpress.AgMenu;assembly=DevExpress.AgMenu.v8.2"
  xmlns:dxms="clr-namespace:DevExpress.AgMenu.DefaultStyle;assembly=DevExpress.AgMenu.v8.2"
  xmlns:dxmi="clr-namespace:DevExpress.AgMenu.Internal;assembly=DevExpress.AgMenu.v8.2">

    <dxm:AgMenuTemplateList x:Key="TemplateCollection;DarkRoom">

        <dxm:AgMenuTemplateListItem Key="Horizontal">
            <dxm:AgMenuTemplateListItem.Template>
                <ControlTemplate TargetType="dxm:AgMenu">
                    <Grid>
                        <Border x:Name="ElementEmptyArea" CornerRadius="0,0,0,0">
                            <Border.Background>
                                <SolidColorBrush Color="#646874"></SolidColorBrush>
                            </Border.Background>
                        </Border>
                        <ItemsPresenter HorizontalAlignment="Left"/>
                    </Grid>
                </ControlTemplate>
            </dxm:AgMenuTemplateListItem.Template>
        </dxm:AgMenuTemplateListItem>

        <dxm:AgMenuTemplateListItem Key="Vertical">
            <dxm:AgMenuTemplateListItem.Template>
                <ControlTemplate TargetType="dxm:AgMenu">
                    <Grid>
                        <Border x:Name="ElementEmptyArea" Background="#9f0d2d" CornerRadius="0,0,0,0"/>
                        <ItemsPresenter VerticalAlignment="Top"/>
                    </Grid>
                </ControlTemplate>
            </dxm:AgMenuTemplateListItem.Template>
        </dxm:AgMenuTemplateListItem>

    </dxm:AgMenuTemplateList>

    <!-- AgMenuItem;Horizontal;ContentPresenter;DarkRoom -->
    <ControlTemplate x:Key="AgMenuItem;Horizontal;ContentPresenter;DarkRoom" TargetType="dxmi:AgMenuItemContentPresenter">
        <Grid x:Name="ElementRoot" Margin="{TemplateBinding Padding}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid x:Name="ElementIconCheckAreaContainer" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center">
                <Grid x:Name="ElementIconCheckArea">
                    <Grid x:Name="ElementIconAreaContainer">
                        <Grid x:Name="ElementIconArea">
                            <ContentControl x:Name="ElementIcon" Content="{TemplateBinding Icon}" Margin="0,1,4,1"/>
                        </Grid>
                    </Grid>
                </Grid>
            </Grid>
            <ContentControl
          FontSize="11"
          FontFamily="Arial"
          Content="{TemplateBinding Header}"
          ContentTemplate="{TemplateBinding HeaderTemplate}"
          Grid.Column="1"
          Grid.Row="0"
          VerticalAlignment="Center"
          Foreground="{TemplateBinding Foreground}"/>
            <ContentControl
          x:Name="ElementContent"
          Content="{TemplateBinding Content}"
          ContentTemplate="{TemplateBinding ContentTemplate}"
          Foreground="{TemplateBinding Foreground}"
          Grid.Column="1"
          Grid.Row="0"/>
        </Grid>
    </ControlTemplate>

 
    <dxm:AgMenuTemplateList x:Key="ItemContainerTemplates;DarkRoom">

        <!-- Top Menu Item - Horizontal (File, Edit etc...) -->
        <dxm:AgMenuTemplateListItem Key="AgMenuItem;Horizontal">
            <dxm:AgMenuTemplateListItem.Template>
                <ControlTemplate TargetType="dxm:AgMenuItem">
                    <Grid x:Name="ElementRoot" Background="#646874">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="#646874"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="#646874"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" To="White"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Hot">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" To="Black"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DroppedDown">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="#646874"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="#646874"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" To="Black"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DroppedDownSelected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" To="Black"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="Opacity" To=".4"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackground" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" To="Black"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border HorizontalAlignment="Stretch" Width="Auto" Grid.ColumnSpan="1"
       BorderThickness="0,0,2,0" BorderBrush="Black" >
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                    <GradientStop x:Name="ElementBackgroundGradient1" Color="#FF6593CF"/>
                                    <GradientStop x:Name="ElementBackgroundGradient2" Color="#FF6593CF" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <dxmi:AgMenuItemContentPresenter x:Name="ElementContentPresenter"
                        Grid.Column="1"
          Foreground="LightGray"
          CheckAreaVisibility = "{TemplateBinding CheckAreaVisibility}"
          Header="{TemplateBinding Header}"
          HeaderTemplate="{TemplateBinding HeaderTemplate}"
          Icon="{TemplateBinding Icon}"
          IsRadioItem="{TemplateBinding IsRadioItem}"
          MenuOrientation="{TemplateBinding MenuOrientation}"
          Padding="7,2,4,2"
          Template="{StaticResource AgMenuItem;Horizontal;ContentPresenter;DarkRoom}"
          VerticalAlignment="Center"
          ViewStyle="{TemplateBinding ViewStyle}"
          Position="{TemplateBinding Position}"/>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </dxm:AgMenuTemplateListItem.Template>
        </dxm:AgMenuTemplateListItem>

        <!-- Top Menu Item - Vertical (File, Edit etc...) -->
        <dxm:AgMenuTemplateListItem Key="AgMenuItem;Vertical">
            <dxm:AgMenuTemplateListItem.Template>
                <ControlTemplate TargetType="dxm:AgMenuItem">
                    <Grid x:Name="ElementRoot">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Hot">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" To="Black"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementArrowBrush" Storyboard.TargetProperty="Color" To="Black"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DroppedDown">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="#9f0d2d"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="#9f0d2d"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" To="Black"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementArrowBrush" Storyboard.TargetProperty="Color" To="Black"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DroppedDownSelected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" To="Black"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementArrowBrush" Storyboard.TargetProperty="Color" To="Black"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="Opacity" To=".4"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementArrowBrush" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" To="Black"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border HorizontalAlignment="Stretch" Grid.ColumnSpan="1" BorderThickness="0,0,2,0" BorderBrush="Black">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                    <GradientStop x:Name="ElementBackgroundGradient1" Color="#FF6593CF"/>
                                    <GradientStop x:Name="ElementBackgroundGradient2" Color="#FF6593CF" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Border x:Name="ElementTopBorder" Height="1" HorizontalAlignment="Stretch" Grid.Row="0" Background="#9f0d2d"/>
                                <Grid Grid.Row="1">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="Auto"/>
                                    </Grid.ColumnDefinitions>
                                    <dxmi:AgMenuItemContentPresenter x:Name="ElementContentPresenter" Grid.Column="0"
                      Foreground="#2D2D2D"
                      CheckAreaVisibility="{TemplateBinding CheckAreaVisibility}"
      Header="{TemplateBinding Header}"
      HeaderTemplate="{TemplateBinding HeaderTemplate}"
      Icon="{TemplateBinding Icon}"
      IsRadioItem="{TemplateBinding IsRadioItem}"
      MenuOrientation="{TemplateBinding MenuOrientation}"
      Padding="11,4,24,5"
      Template="{StaticResource AgMenuItem;Vertical;ContentPresenter;DarkRoom}"
      VerticalAlignment="Top"
      ViewStyle="{TemplateBinding ViewStyle}"
      Position="{TemplateBinding Position}"/>
                                    <dxms:AgMenuSubItemArrowDefaultStyleHelper  Grid.Column="1" Margin="0,0,7,1">
                                        <dxms:AgMenuSubItemArrowDefaultStyleHelper.Background>
                                            <SolidColorBrush x:Name="ElementArrowBrush" Color="#9f0d2d"/>
                                        </dxms:AgMenuSubItemArrowDefaultStyleHelper.Background>
                                    </dxms:AgMenuSubItemArrowDefaultStyleHelper>
                                </Grid>
                                <Border Height="1" HorizontalAlignment="Stretch" Grid.Row="2" VerticalAlignment="Bottom" Background="#9f0d2d"/>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </dxm:AgMenuTemplateListItem.Template>
        </dxm:AgMenuTemplateListItem>

        <!-- Sub Menu Item (File|New, File|Exit etc...) -->
        <dxm:AgMenuTemplateListItem Key="AgMenuItem;Vertical;PopupMenuItem">
            <dxm:AgMenuTemplateListItem.Template>
                <ControlTemplate TargetType="dxm:AgMenuItem">
                    <Grid x:Name="ElementRoot">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Hot">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="#FFBFDBFF"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="#FFBFDBFF"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementIconBackground" Storyboard.TargetProperty="Color" To="#FFBFDBFF"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DroppedDown"/>
                                <VisualState x:Name="DroppedDownSelected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementIconBackground" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="Opacity" To=".4"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementIconBackground" Storyboard.TargetProperty="Color" To="White"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border HorizontalAlignment="Left" Width="26" >
                            <Border.Background>
                                <SolidColorBrush x:Name="ElementIconBackground" Color="White"/>
                            </Border.Background>
                        </Border>

                        <Border HorizontalAlignment="Stretch" Margin="26,0,0,0"
      Width="Auto" BorderThickness="0">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                    <GradientStop x:Name="ElementBackgroundGradient1"
          Color="White"/>
                                    <GradientStop x:Name="ElementBackgroundGradient2"
          Color="White" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                        </Border>

                        <Border HorizontalAlignment="Stretch" Margin="0,0,0,0" Width="Auto" Padding="0">
                            <dxmi:AgMenuItemContentPresenter x:Name="ElementContentPresenter"
          Foreground="{TemplateBinding Foreground}"
          CheckAreaVisibility="{TemplateBinding CheckAreaVisibility}"
          Header="{TemplateBinding Header}"
          HeaderTemplate="{TemplateBinding HeaderTemplate}"
          Icon="{TemplateBinding Icon}"
          IsRadioItem="{TemplateBinding IsRadioItem}"
          Margin="4,0,30,0"
                      MinHeight="22"
                      VerticalAlignment="Center"
          MenuOrientation="{TemplateBinding MenuOrientation}"
          Template="{StaticResource AgMenuItem;Vertical;PopupMenuItemContentPresenter;DarkRoom}"
          ViewStyle="{TemplateBinding ViewStyle}"
          Position="{TemplateBinding Position}"/>
                        </Border>

                    </Grid>
                </ControlTemplate>
            </dxm:AgMenuTemplateListItem.Template>
        </dxm:AgMenuTemplateListItem>

        <!-- Sub Menu Item (File|New|Project.., File|New|Web Site etc...) -->
        <dxm:AgMenuTemplateListItem Key="AgMenuItem;Vertical;PopupMenuSubItem">
            <dxm:AgMenuTemplateListItem.Template>
                <ControlTemplate TargetType="dxm:AgMenuItem">
                    <Grid x:Name="ElementRoot">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="Hot">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementIconBackground" Storyboard.TargetProperty="Color" To="White"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="DroppedDown"/>
                                <VisualState x:Name="DroppedDownSelected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementIconBackground" Storyboard.TargetProperty="Color" To="White"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementContentPresenter" Storyboard.TargetProperty="Opacity" To=".4"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient1" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementBackgroundGradient2" Storyboard.TargetProperty="Color" To="White"/>
                                        <ColorAnimation Duration="0:0:0.01" Storyboard.TargetName="ElementIconBackground" Storyboard.TargetProperty="Color" To="White"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border HorizontalAlignment="Left" Width="26">
                            <Border.Background>
                                <SolidColorBrush x:Name="ElementIconBackground" Color="White"/>
                            </Border.Background>
                        </Border>
                        <Border HorizontalAlignment="Stretch" Margin="26,0,0,0" Width="Auto">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                    <GradientStop x:Name="ElementBackgroundGradient1" Color="White"/>
                                    <GradientStop x:Name="ElementBackgroundGradient2" Color="White" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.Background>
                        </Border>

                        <Border HorizontalAlignment="Stretch" Margin="0,0,0,0" Width="Auto" Padding="4,2,4,2">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <dxmi:AgMenuItemContentPresenter
                        x:Name="ElementContentPresenter" Grid.Column="0"
          Foreground="{TemplateBinding Foreground}"
          CheckAreaVisibility="{TemplateBinding CheckAreaVisibility}"
          Header="{TemplateBinding Header}"
          HeaderTemplate="{TemplateBinding HeaderTemplate}"
          Icon="{TemplateBinding Icon}"
          IsRadioItem="{TemplateBinding IsRadioItem}"
          Margin="0,0,30,0"
          MenuOrientation="{TemplateBinding MenuOrientation}"
          Template="{StaticResource Vertical;PopupMenuSubItemContentPresenter;Darkroom}"
          ViewStyle="{TemplateBinding ViewStyle}"
          Position="{TemplateBinding Position}"/>
                                <!--<Path x:Name="BlackTriangle"
          Stretch="Fill" Fill="Black"
          Data="F1 M 394,286L 400,283L 400,282L 394,279L 394,286 Z " Height="7" Width="6" Grid.Column="1"/>-->
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </dxm:AgMenuTemplateListItem.Template>
        </dxm:AgMenuTemplateListItem>

        <dxm:AgMenuTemplateListItem Key="AgMenuSeparator;Vertical;PopupMenuItem">
            <dxm:AgMenuTemplateListItem.Template>
                <ControlTemplate TargetType="dxm:AgMenuSeparator">
                    <Grid>
                        <Border Background="#FFE9EEEE" HorizontalAlignment="Left"
                        Width="26">
                        </Border>
                        <Grid Margin="26,0,0,0">
                            <Border Height="1" Margin="8,1,8,0" Background="#FF9AC6FF" BorderThickness="0,0,0,0"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </dxm:AgMenuTemplateListItem.Template>
        </dxm:AgMenuTemplateListItem>
    </dxm:AgMenuTemplateList>

    <ControlTemplate TargetType="dxm:AgPopupMenu" x:Key="AgPopupMenuTemplate;DarkRoom">
        <Grid>
            <Grid Margin="0,0,0,0">
                <Border Background="Black" />
                <dxms:AgSubMenuDefaultStyleHelper Background="Black"/>
                <Border Background="Black" Margin="1,1,1,1">
                    <dxmi:AgMenuScrollViewer x:Name="ItemsPresenterContainer"
                      ScrollButtonClickMode="{TemplateBinding ScrollButtonClickMode}" Margin="0,0,0,0">
                        <ItemsPresenter/>
                    </dxmi:AgMenuScrollViewer>
                </Border>
            </Grid>
        </Grid>
    </ControlTemplate>

    <Style TargetType="dxm:AgPopupMenu" x:Key="AgPopupMenu;DarkRoom">
        <Setter Property="Template" Value="{StaticResource AgPopupMenuTemplate;DarkRoom}"/>
        <Setter Property="ItemContainerTemplates" Value="{StaticResource ItemContainerTemplates;DarkRoom}"/>
    </Style>

    <Style TargetType="dxm:AgMenu" x:Key="AgMenu;DarkRoom">
        <Setter Property="Templates" Value="{StaticResource TemplateCollection;DarkRoom}"/>
        <Setter Property="ItemContainerTemplates" Value="{StaticResource ItemContainerTemplates;DarkRoom}"/>
        <Setter Property="SubMenuStyle" Value="{StaticResource AgPopupMenu;DarkRoom}"/>
    </Style>

</ResourceDictionary>