<telerik:GridViewColumn Width="*" Header="Sailor" IsSortable="True" > <telerik:GridViewColumn.CellTemplate> <DataTemplate> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <TextBlock Text="{Binding Name}" /> <Image Source="{DynamicResource User_Man_Padlock}" Grid.Column="1" Margin="0,0,10,0" ToolTip="{Binding DetailRequisitionAssignedTo, Converter={StaticResource DetailRequisitionConverter}}" Height="15" > <Image.Visibility> <MultiBinding Converter="{StaticResource SailorLockVisibilityConverter}" ConverterParameter="Left"> <Binding Path="DetailRequisitionAssignedTo" /> <Binding RelativeSource="{RelativeSource AncestorType={x:Type local:MainWindow}}" Path="DataContext.SailorsOnLeft" /> <Binding RelativeSource="{RelativeSource AncestorType={x:Type local:MainWindow}}" Path="DataContext.SelectedJobInformation" /> </MultiBinding> </Image.Visibility> </Image> <Image Source="{DynamicResource Padlock}" Grid.Column="1" Margin="0,0,10,0" ToolTip="{Binding DetailRequisitionAssignedTo, Converter={StaticResource DetailRequisitionConverter}}" Height="15" > <Image.Visibility> <MultiBinding Converter="{StaticResource SailorLockVisibilityConverter}" ConverterParameter="Right"> <Binding Path="DetailRequisitionAssignedTo" /> <Binding RelativeSource="{RelativeSource AncestorType={x:Type local:MainWindow}}" Path="DataContext.SailorsOnLeft" /> <Binding RelativeSource="{RelativeSource AncestorType={x:Type local:MainWindow}}" Path="DataContext.SelectedJobInformation" /> </MultiBinding> </Image.Visibility> </Image> <Image Source="{DynamicResource User_Man_Padlock}" Grid.Column="1" Margin="0,0,10,0" ToolTip="{Binding DetailRequisitionAssignedTo, Converter={StaticResource DetailRequisitionConverter}}" Height="15" > <Image.Visibility> <MultiBinding Converter="{StaticResource SailorLockVisibilityConverter}" ConverterParameter="AssignedTo"> <Binding Path="DetailRequisitionAssignedTo" /> <Binding RelativeSource="{RelativeSource AncestorType={x:Type local:MainWindow}}" Path="DataContext.SailorsOnLeft" /> <Binding RelativeSource="{RelativeSource AncestorType={x:Type local:MainWindow}}" Path="DataContext.SelectedJobInformation" /> </MultiBinding> </Image.Visibility> </Image> </Grid> </DataTemplate> </telerik:GridViewColumn.CellTemplate> </telerik:GridViewColumn><telerikPresentation:RadComboBox TabIndex="4" Height="54" Name="cmbCustomer" TextSearch.TextPath="cust_name" Style="{StaticResource requiredFieldValidationStyle}" SelectedIndex="0" SelectedItem="{Binding cust_name, Mode=TwoWay}" SelectedValue="{Binding Path=cust_name}" SelectedValuePath="cust_name" Width="332" >
<telerikPresentation:RadComboBox.Effect>
<DropShadowEffect BlurRadius="0" ShadowDepth="2" />
</telerikPresentation:RadComboBox.Effect>
<telerikPresentation:RadComboBox.ItemTemplate>
<DataTemplate>
<Grid Margin="5" Width="300">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock FontWeight="Bold" x:Name="txtCUST_NAME" Grid.ColumnSpan="2" Text="{Binding cust_name}" />
<TextBlock Foreground="Navy" Grid.ColumnSpan="3" Grid.Row="1" Margin="10,0,0,0" Text="{Binding address}" />
<TextBlock Foreground="Navy" Grid.Column="0" Grid.Row="2" Margin="10,0,0,0" Text="{Binding city}" />
<TextBlock Foreground="Navy" Grid.Column="1" Grid.Row="2" Margin="0" Text="{Binding state}" />
<TextBlock Foreground="Navy" Grid.Column="2" Grid.Row="2" Margin="-20,0,0,0" Text="{Binding zipcode}" />
</Grid>
</DataTemplate>
</telerikPresentation:RadComboBox.ItemTemplate>
</telerikPresentation:RadComboBox>
<ScrollContentPresenter Grid.Row="2" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False"> <ScrollContentPresenter.Content> <StackPanel Orientation="Vertical"> <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" />
<!-- Loading indicator --> <Button Content="Loading..." /> </StackPanel> </ScrollContentPresenter.Content></ScrollContentPresenter>
public class TreeFolderHierarchyItem : INotifyPropertyChanged
{
#region properties
private string _header;
private bool _isexpanded;
private string _defaultimagesrc;
private string _expandedimagesrc;
private string _collapsedimagesrc;
private TreeFolderItem _tag;
private TreeFolderHierarchy _items;
public string Header
{
get { return _header; }
set
{
if (value != _header)
{
_header = value;
OnPropertyChange("Header");
}
}
}
public bool IsExpanded
{
get { return _isexpanded; }
set {
if (value != _isexpanded)
{
_isexpanded = value;
OnPropertyChange("IsExpanded");
}
}
}
public string DefaultImageSource
{
get { return _defaultimagesrc; }
set
{
if (value != _defaultimagesrc)
{
_defaultimagesrc = value;
OnPropertyChange("DefaultImageSource");
}
}
}
public string ExpandedImageSource
{
get { return _expandedimagesrc; }
set
{
if (value != _expandedimagesrc)
{
_expandedimagesrc = value;
OnPropertyChange("ExpandedImageSource");
}
}
}
public string CollapsedImageSource
{
get { return _collapsedimagesrc; }
set
{
if (value!= _collapsedimagesrc)
{
_collapsedimagesrc = value;
OnPropertyChange("CollapsedImageSource");
}
}
}
public TreeFolderItem Tag
{
get { return _tag; }
set
{
if (value != _tag)
{
_tag = value;
OnPropertyChange("Tag");
}
}
}
public TreeFolderHierarchy Items
{
get
{
return _items;
}
set
{
if (value != _items)
{
_items = value;
OnPropertyChange("Child");
}
}
}
public int ID
{
get { return Tag.ID; }
set {
if (value != Tag.ID)
{
Tag.ID = value;
OnPropertyChange("ID");
}
}
}
public TreeFolderHierarchyItem(TreeFolderItem tag, bool isexpanded )
{
_items = new TreeFolderHierarchy();
if (tag == null)
throw new ArgumentException();
_tag = tag;
SetProperties(isexpanded);
}
private void SetProperties(bool isexpanded)
{
_header = _tag.Titre;
_isexpanded = isexpanded;
switch (_tag.Type)
{
case TreeFolderType.Acte:
_defaultimagesrc = "folder.png";
_expandedimagesrc = "openedfolder.png";
_collapsedimagesrc = "folder.png";
break;
case TreeFolderType.Message:
_defaultimagesrc = "sent.png";
_expandedimagesrc = "sent.png";
_collapsedimagesrc = "sent.png";
break;
case TreeFolderType.Pdf:
_defaultimagesrc = "3Drafts.png";
_expandedimagesrc = "3Drafts.png";
_collapsedimagesrc = "3Drafts.png";
break;
case TreeFolderType.Libre:
_defaultimagesrc = "1PersonalFolder.png";
_expandedimagesrc = "1PersonalFolder.png";
_collapsedimagesrc = "1PersonalFolder.png";
break;
}
}
#endregion
public event PropertyChangedEventHandler PropertyChanged;
// Helper Methods
private void OnPropertyChange(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}