|
Hi..
I am using hierarchical data template in tree view in my wpf application using mvvm pattern.
Binding of data using observable collection done successfully through viewmodel..
But my problem is in getting selected item..
Can anybody tell me how to get selected item in treeview in mvvm pattern.....?
|
|
|
|
|
Try reading Josh's article on MVVM with the Treeview[^]. Download the code and see how Josh does it.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I only tested this in Silverlight, should be the same in WPF though.
You can in fact bind to SelectedItem on the TreeView
<controls:TreeView ItemsSource="{Binding KeywordSource}" SelectedItem="{Binding SelectedKeyword, Mode=TwoWay}">
Blend throws an error, noting (correctly) that SelectedItem has not have an accessible setter, which is also the reason you will not get the SelectedItem in Intellisense. If I understand correctly however, you just need the getter, which is working for me.
|
|
|
|
|
Setting the Mode on the Binding of the SelectedItem to OneWayToSourceeliminates the error message
<controls:TreeView ItemsSource="{Binding KeywordSource}" SelectedItem="{Binding SelectedKeyword, Mode=OneWayToSource}">
I lied, throws a compile time error...
|
|
|
|
|
I have been struggling with this issue for some time, and I have now constructed a simple example to demonstate the problem. I am not sure whether this is an issue with WPF or my lack of understanding.
As part of our application, I have created a wizard along the lines of Creating an Internationalized Wizard in WPF. This uses the MVVM pattern and the various pages of the wizard are implemented in User Controls.
The problem that I have is when the wizard window is resized, the UserControl does not take the height of the window. However it does take the width of the window. The result is that controls such as a list box, which the user may need to have resize with the window, do not resize.
I have removed the complexity of our app, and created a very simple example with a window, that just contains a HeaderedContentControl, which contains the model for the UserControl.
The window is
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:UserControlDemo"
Title="Window1" Height="300" Width="300">
<Window.Resources>
<DataTemplate DataType="{x:Type local:SimpleUserControlModel}">
<local:SimpleUserControl />
</DataTemplate>
</Window.Resources>
<Grid>
<HeaderedContentControl Name="hcControl" Margin="20" Content="{x:Type local:SimpleUserControl}"
Height="auto" Width="auto" VerticalContentAlignment="Stretch" />
</Grid>
</Window>
Window code:
Class Window1
Private _simpleModel As SimpleUserControlModel
Public Sub New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call.
_simpleModel = New SimpleUserControlModel
hcControl.Content = _simpleModel
End Sub
End Class
User control:
<UserControl x:Class="SimpleUserControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
<Grid>
<Border Margin="5" BorderThickness="5" BorderBrush="Red" />
</Grid>
</UserControl>
User control model:
Public Class SimpleUserControlModel
End Class
The UserControl just contains a red border, which makes it easy to see its size. If you run the application and drag the corner of window1, the width of the red border changes, but its height remains at 0. Checking the height (in fact it is the ActualHeight property) of the HeaderedContentControl, it is set as expected (about 260) - I had expected the UserControl would inherit the value of this property, so its height would be set automatically.
It would be greatly appreciated if someone could explain what I am missing here...
Please note that a workaround is relatively easy and has been implemented in our app: add a property for the required height to SimpleUserControlModel then bind the UserControl height to the property. Then by catching the Window's SizeChanged event, the property can be updated (its not quite that simple, because you also need a timer to add a delay to avoid handling every window SizeChanged event).
Thanks for any help.
Tim
|
|
|
|
|
The default template for a HeaderedContentControl is
<ControlTemplate TargetType="{x:Type HeaderedContentControl}">
<StackPanel>
<ContentPresenter ContentSource="Header"/>
<ContentPresenter />
</StackPanel>
</ControlTemplate>
which gives you the behavior you're seeing, because they used a StackPanel.
I would use a grid in the HeaderedContentControl template instead.
Here's an example (simplifying your example even more):
<Window.Resources>
<Style x:Key="HeaderedContentControlStyle1" TargetType="{x:Type HeaderedContentControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type HeaderedContentControl}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ContentPresenter Grid.Row="0" ContentSource="Header"/>
<ContentPresenter Grid.Row="1" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<HeaderedContentControl Name="hcControl" Margin="20" Style="{DynamicResource HeaderedContentControlStyle1}" >
<Grid>
<Border Margin="5" BorderThickness="5" BorderBrush="Red" />
</Grid>
</HeaderedContentControl>
</Grid>
Mark Salsbery
Microsoft MVP - Visual C++
modified on Tuesday, May 19, 2009 12:48 PM
|
|
|
|
|
Mark,
Thanks for the simple solution to this problem! I can see now that I needed to have a style with a control template to define the behaviour of the HeaderedContentControl. Reading the help page again, I can see I missed "A HeaderedContentControl has a limited default style. An application developer can create a HeaderedContentControl, but its appearance will be very simple."
Note that we need to use a UserControl, to represent a number of more complex "pages", which are swapped in / out in code as the user steps through the wizard. That is why we need the user control rather than the simpler approach you presented.
I will implement this back in our application and hopefully it will solve the original problem.
Regards,
Tim
|
|
|
|
|
ausadmin wrote: That is why we need the user control rather than the simpler approach you presented.
Right, I figured that. I just wrapped it all into simple XAML
so you could copy/paste it and try it out.
The key point was the custom template
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank you for saving my day!
|
|
|
|
|
Hello all,
Basically i am trying to format single word in textbox. For eg. if user types 'Or' , 'and' i want to hilight them and bold them. This i am doing by extending textbox control and overriding OnRender. I could able to do that, but the problem is the cursor position is getting messup, in other words, when words are becoming bold cursor position is not getting adjusted accordingly, and am not sure how to do that. Here is my code
<br />
protected override void OnRender(DrawingContext drawingContext)<br />
{<br />
<br />
if (this.Text != "")<br />
{<br />
this.Background = new SolidColorBrush(Colors.Transparent);<br />
<br />
FormattedText formattedText = new FormattedText(<br />
this.Text,<br />
System.Threading.Thread.CurrentThread.CurrentCulture,<br />
FlowDirection.LeftToRight,<br />
new Typeface(this.FontFamily,this.FontStyle, this.FontWeight,this.FontStretch),<br />
this.FontSize, Brushes.Black<br />
);
<br />
<br />
double leftMargin = 4.0 + this.BorderThickness.Left;<br />
double topMargin = 2 + this.BorderThickness.Top;<br />
<br />
formattedText.MaxTextHeight = Math.Max(this.ActualHeight + this.VerticalOffset, 0);
drawingContext.PushClip(new RectangleGeometry(new Rect(0, 0, this.ActualWidth, this.ActualHeight)));
<br />
<br />
List<Pair> ranges = dec.Ranges(this.Text);<br />
foreach (Pair p in ranges)<br />
{<br />
formattedText.SetForegroundBrush(Brushes.Blue, p.Start, p.Length);<br />
formattedText.SetFontWeight(FontWeights.Bold, p.Start, p.Length);<br />
<br />
}<br />
<br />
<br />
drawingContext.DrawText(formattedText, new Point(leftMargin - this.HorizontalOffset-2,topMargin));<br />
}<br />
}<br />
Any help would be appreciated.
Thanks.
|
|
|
|
|
I'm not sure how you expect the TextBox to know about any formatted text
you've rendered.
TextBox doesn't support formatted text - RichTextBox does.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Hi guys,
I want to start doing some samples in Silverlight. Was just wondering whether i shud have knowledge in ASp.net, for getting started in Silverlight. Pls give me a hint, from where shud i begin.??
Thnkx
Sandeep
The name is Sandeep
|
|
|
|
|
You might want to buy a book or two. My good friend Laurent Bugnion has written a rather good one called Silverlight 2 Unleashed[^].
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Try Jesse Liberty's Tutorials[^]
These are in both C# and VB. If you're a VB developer one of the problems is that the vast majority of snippets on the web are in C#.
Re: buying a book, one thing to be aware of is that Silverlight 3 books will be appearing in the late summer so I would avoid buying a book now unless you have to.
Again, if you're a VB developer then APress's "Pro Silverlight 2 in VB" (there's a C# version as well) looks good and it's also in colour. But the Silverlight 3 versions are already listed!
Some knowledge of ASP.NET helps but is not essential.
Kevin
|
|
|
|
|
thanks guys..
The name is Sandeep
|
|
|
|
|
Hello,
I am embarking on my first WPF project and am looking for the best way to implement a flexible master-detail view.
The project will have several views, each bound to a different underlying data source via view models. I want to produce a 'detail' view which will display the details for the currently selected object in any one of the main views. Therefore, this detail view must be flexible enough to display properties for any one of a variety of differnt object types.
What is the best technique to perform this type of 'dynamic' data binding in WPF? Is it possible purely using data templates or would I need to use something like DataSourceProvider?
Thanks!
Dan
|
|
|
|
|
You may or may not need DataSourceProvider.
For the detail view, DataTemplates work nicely since you can specify a
template for each object type (using the DataType property) so the appropriate
template is chosen automagically for any given source object.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks, thats good news..
I have had a go at implementing this using a ContentControl to display item details but have come across a further problem. I dont want to explicitly set the ContentTemplate of the content control. Instead I need this to be selected based on the type of content currently selected. I have created a set of data templates and associated each with a DataType but the content control does not pick these up. Should this work?
Thanks
Dan
|
|
|
|
|
daniel radford wrote: I have created a set of data templates and associated each with a DataType but the content control does not pick these up. Should this work?
Yes.
Make sure your master list has IsSynchronizedWithCurrentItem set to true,
and your detail's Content is binded (bound? ) to the same collection used by the master.
Example: Different DataTemplates for different types[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Apologies, I had my DataType syntax incorrect - I now have it working perfectly. Thanks for the help!
I have a related follow up question regarding the architecture of my project. As I described before, I have several views each bound to a different viewmodel over differnt data. At the moment, each viewmodel will have a CurrentItem selected but ideally I want some kind of 'master' selection context so that only a single item is selected at any one time in the entire interface. i.e. this master viewmodel must be shared between the various views to maintain a single selected item. (I hope that makes sense!)
What is the best way to approach this?
Cheers
Dan
|
|
|
|
|
Hi,
I need to bind by data as UserControls inside a WrapPanel.
I have an ObservableCollection which is binded to the UserControl inside the WrapPanel.
If I am adding 100 data, it is working fine. But, if my data increases it is taking time to adding those usercontrols inside the panel (it becomes hanged). I need to show near about 10000 usercontrols inside the panel. OfCourse, there will be scroll to show these huge data. On every second, I am changing the collection data properties. Not adding or removing any data object but just changing the properties exposed for those data. At that time too, it becomes hanged. I need to show those data & need to change in every second.
Please help me in this matter. I am using WPF 3.5 with SP1. I checked different articles on the net & those didn't solve my problem.
Your early response regarding the same is highly appreciable.
Thanks & Regards,
- K
|
|
|
|
|
Try using a VirtualizingStackPanel, if you need the same behaviour as a WrapPanel there are some results that might help if you search for VirtualizingWrapPanel. Did you look at this article on WPF: Data Virtualization?
|
|
|
|
|
When a tab is selected, I get a line (the border of the tab control) under the tab. I want to get rid of the line between the tab content and the tabitem. This probably has something to do with the templates I'm using, but I'm not sure what I can do to address the issue. I looked around to see if you could set the color for a border on a side-by-side basis, but it doesn't look like you can. Can anyone help?
Here is my resource dictionary xaml file (in it's entirety - big text alert):
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mscorlib="clr-namespace:System;assembly=mscorlib"
>
<Style x:Key="StyleUDPBaseRepeatButton" TargetType="{x:Type RepeatButton}" >
<Style.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" Value="0.40" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="StyleTabControlRepeatButton" TargetType="{x:Type RepeatButton}" BasedOn="{StaticResource StyleUDPBaseRepeatButton}" >
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Border CornerRadius="13" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ======================================================================================================== -->
<!-- Scroller buttons for scrolling tabs -->
<Style x:Key="StyleButtonTabScrollRepeatPrev" TargetType="{x:Type RepeatButton}" BasedOn="{StaticResource StyleTabControlRepeatButton}" >
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RepeatButton}">
<Image Source="/CometResources;component/Images/GlassPrevTab64.png" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="StyleButtonTabScrollRepeatNext" TargetType="{x:Type RepeatButton}" BasedOn="{StaticResource StyleTabControlRepeatButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RepeatButton}">
<Image Source="/CometResources;component/Images/GlassNextTab64.png" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- TabItem with rounded corners -->
<ControlTemplate TargetType="TabItem" x:Key="UDPTabItem">
<Grid SnapsToDevicePixels="True">
<Border BorderThickness="1,1,1,0"
Padding="{TemplateBinding Control.Padding}"
BorderBrush="{TemplateBinding Border.BorderBrush}"
Background="{TemplateBinding Panel.Background}"
Name="Bd"
CornerRadius="4,4,0,0" >
<ContentPresenter RecognizesAccessKey="True"
Content="{TemplateBinding HeaderedContentControl.Header}"
ContentTemplate="{TemplateBinding HeaderedContentControl.HeaderTemplate}"
ContentStringFormat="{TemplateBinding HeaderedContentControl.HeaderStringFormat}"
ContentSource="Header"
Name="Content"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="UIElement.IsMouseOver">
<Setter Property="Panel.Background" TargetName="Bd">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<LinearGradientBrush.GradientStops>
<GradientStop Color="#FFEAF6FD" Offset="0.15" />
<GradientStop Color="#FFD9F0FC" Offset="0.5" />
<GradientStop Color="#FFBEE6FD" Offset="0.5" />
<GradientStop Color="#FFA7D9F5" Offset="1" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Trigger.Value>
<mscorlib:Boolean>True</mscorlib:Boolean>
</Trigger.Value>
</Trigger>
<Trigger Property="Selector.IsSelected">
<Setter Property="Panel.ZIndex">
<Setter.Value>
<mscorlib:Int32>1</mscorlib:Int32>
</Setter.Value>
</Setter>
<Setter Property="Panel.Background" TargetName="Bd">
<Setter.Value>
<SolidColorBrush>#FFF9F9F9</SolidColorBrush>
</Setter.Value>
</Setter>
<Trigger.Value>
<mscorlib:Boolean>True</mscorlib:Boolean>
</Trigger.Value>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Selector.IsSelected">
<Condition.Value>
<mscorlib:Boolean>False</mscorlib:Boolean>
</Condition.Value>
</Condition>
<Condition Property="UIElement.IsMouseOver">
<Condition.Value>
<mscorlib:Boolean>True</mscorlib:Boolean>
</Condition.Value>
</Condition>
</MultiTrigger.Conditions>
<Setter Property="Border.BorderBrush" TargetName="Bd">
<Setter.Value>
<SolidColorBrush>#FF3C7FB1</SolidColorBrush>
</Setter.Value>
</Setter>
</MultiTrigger>
<Trigger Property="TabItem.TabStripPlacement">
<Setter Property="Border.BorderThickness" TargetName="Bd">
<Setter.Value>
<Thickness>1,0,1,1</Thickness>
</Setter.Value>
</Setter>
<Trigger.Value>
<x:Static Member="Dock.Bottom" />
</Trigger.Value>
</Trigger>
<Trigger Property="TabItem.TabStripPlacement">
<Setter Property="Border.BorderThickness" TargetName="Bd">
<Setter.Value>
<Thickness>1,1,0,1</Thickness>
</Setter.Value>
</Setter>
<Trigger.Value>
<x:Static Member="Dock.Left" />
</Trigger.Value>
</Trigger>
<Trigger Property="TabItem.TabStripPlacement">
<Setter Property="Border.BorderThickness" TargetName="Bd">
<Setter.Value>
<Thickness>0,1,1,1</Thickness>
</Setter.Value>
</Setter>
<Trigger.Value>
<x:Static Member="Dock.Right" />
</Trigger.Value>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Selector.IsSelected">
<Condition.Value>
<mscorlib:Boolean>True</mscorlib:Boolean>
</Condition.Value>
</Condition>
<Condition Property="TabItem.TabStripPlacement" Value="{x:Static Dock.Top}" />
</MultiTrigger.Conditions>
<Setter Property="FrameworkElement.Margin">
<Setter.Value>
<Thickness>-2,-2,-2,-1</Thickness>
</Setter.Value>
</Setter>
<Setter Property="FrameworkElement.Margin" TargetName="Content">
<Setter.Value>
<Thickness>0,0,0,1</Thickness>
</Setter.Value>
</Setter>
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Selector.IsSelected">
<Condition.Value>
<mscorlib:Boolean>True</mscorlib:Boolean>
</Condition.Value>
</Condition>
<Condition Property="TabItem.TabStripPlacement" Value="{x:Static Dock.Bottom}" />
</MultiTrigger.Conditions>
<Setter Property="FrameworkElement.Margin">
<Setter.Value>
<Thickness>-2,-1,-2,-2</Thickness>
</Setter.Value>
</Setter>
<Setter Property="FrameworkElement.Margin" TargetName="Content">
<Setter.Value>
<Thickness>0,1,0,0</Thickness>
</Setter.Value>
</Setter>
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Selector.IsSelected">
<Condition.Value>
<mscorlib:Boolean>True</mscorlib:Boolean>
</Condition.Value>
</Condition>
<Condition Property="TabItem.TabStripPlacement" Value="{x:Static Dock.Left}" />
</MultiTrigger.Conditions>
<Setter Property="FrameworkElement.Margin">
<Setter.Value>
<Thickness>-2,-2,-1,-2</Thickness>
</Setter.Value>
</Setter>
<Setter Property="FrameworkElement.Margin" TargetName="Content">
<Setter.Value>
<Thickness>0,0,1,0</Thickness>
</Setter.Value>
</Setter>
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Selector.IsSelected">
<Condition.Value>
<mscorlib:Boolean>True</mscorlib:Boolean>
</Condition.Value>
</Condition>
<Condition Property="TabItem.TabStripPlacement" Value="{x:Static Dock.Right}" />
</MultiTrigger.Conditions>
<Setter Property="FrameworkElement.Margin">
<Setter.Value>
<Thickness>-1,-2,-2,-2</Thickness>
</Setter.Value>
</Setter>
<Setter Property="FrameworkElement.Margin" TargetName="Content">
<Setter.Value>
<Thickness>1,0,0,0</Thickness>
</Setter.Value>
</Setter>
</MultiTrigger>
<Trigger Property="UIElement.IsEnabled">
<Setter Property="Panel.Background" TargetName="Bd">
<Setter.Value>
<SolidColorBrush>#FFF4F4F4</SolidColorBrush>
</Setter.Value>
</Setter>
<Setter Property="Border.BorderBrush" TargetName="Bd">
<Setter.Value>
<SolidColorBrush>#FFC9C7BA</SolidColorBrush>
</Setter.Value>
</Setter>
<Setter Property="TextElement.Foreground">
<Setter.Value>
<DynamicResource ResourceKey="{x:Static SystemColors.GrayTextBrushKey}" />
</Setter.Value>
</Setter>
<Trigger.Value>
<mscorlib:Boolean>False</mscorlib:Boolean>
</Trigger.Value>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<!-- Account Manager WINDOW tab control -->
<ControlTemplate x:Key="UDPTemplateTabControl" TargetType="{x:Type TabControl}">
<Grid x:Name="Grid" KeyboardNavigation.TabNavigation="Local">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="ColumnDefinition0"/>
<ColumnDefinition x:Name="ColumnDefinition1" Width="0"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition x:Name="RowDefinition0" Height="Auto"/>
<RowDefinition x:Name="RowDefinition1" Height="*"/>
</Grid.RowDefinitions>
<Border Grid.Row="1"
Grid.Column="0"
x:Name="ContentPanel"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
KeyboardNavigation.TabIndex="2"
KeyboardNavigation.TabNavigation="Local"
KeyboardNavigation.DirectionalNavigation="Contained"
Background="{TemplateBinding Background}"
CornerRadius="6,6,6,6">
<ContentPresenter DataContext="{x:Null}" Margin="{TemplateBinding Padding}"
x:Name="PART_SelectedContentHost"
Content="{TemplateBinding SelectedContent}"
ContentTemplate="{TemplateBinding SelectedContentTemplate}"
ContentTemplateSelector="{TemplateBinding SelectedContentTemplateSelector}"
ContentSource="SelectedContent"/>
</Border>
<ScrollViewer x:Name="HeaderPanel" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Disabled">
<ScrollViewer.Style>
<Style TargetType="{x:Type ScrollViewer}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<!--<Grid Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" x:Name="HeaderPanel">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="23"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="23"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="23" MinHeight="23" />
</Grid.RowDefinitions>
<RepeatButton x:Name="accountPrevTab"
Grid.Column="0"
Command="ScrollBar.LineLeftCommand"
Style="{DynamicResource StyleButtonTabScrollRepeatPrev}" />
<ScrollContentPresenter Grid.Column="1" Content="{TemplateBinding ScrollViewer.Content}" />
<RepeatButton x:Name="accountNextTab" Grid.Column="2" Command="ScrollBar.LineRightCommand" Style="{DynamicResource StyleButtonTabScrollRepeatNext}"/>
</Grid>-->
<Grid Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" x:Name="HeaderPanel">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="23"/>
<ColumnDefinition Width="5" />
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5" />
<ColumnDefinition Width="23"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="23" MinHeight="23" />
</Grid.RowDefinitions>
<RepeatButton x:Name="accountPrevTab"
Grid.Column="0"
Command="ScrollBar.LineLeftCommand"
Style="{StaticResource StyleButtonTabScrollRepeatPrev}" />
<Grid Grid.Column="1" />
<ScrollContentPresenter Grid.Column="2" Content="{TemplateBinding ScrollViewer.Content}" />
<Grid Grid.Column="3" />
<RepeatButton x:Name="accountNextTab"
Grid.Column="4"
Command="ScrollBar.LineRightCommand"
Style="{StaticResource StyleButtonTabScrollRepeatNext}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ScrollViewer.Style>
<StackPanel IsItemsHost="true" Orientation="Horizontal" Background="{x:Null}" KeyboardNavigation.TabIndex="1" />
</ScrollViewer>
</Grid>
</ControlTemplate>
</ResourceDictionary>
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
modified on Tuesday, May 19, 2009 4:55 PM
|
|
|
|
|
I've played with this problem in Blend, and I haven't been able to resolve the issue.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|