Click here to Skip to main content
15,889,365 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: SL, WPF, ASP.NET or ASP MVC Pin
SledgeHammer0112-Jan-11 11:30
SledgeHammer0112-Jan-11 11:30 
GeneralRe: SL, WPF, ASP.NET or ASP MVC Pin
ToddHileHoffer13-Jan-11 15:39
ToddHileHoffer13-Jan-11 15:39 
GeneralRe: SL, WPF, ASP.NET or ASP MVC Pin
Pete O'Hanlon13-Jan-11 21:33
mvePete O'Hanlon13-Jan-11 21:33 
GeneralRe: SL, WPF, ASP.NET or ASP MVC Pin
ToddHileHoffer14-Jan-11 2:24
ToddHileHoffer14-Jan-11 2:24 
GeneralRe: SL, WPF, ASP.NET or ASP MVC Pin
ToddHileHoffer14-Jan-11 4:50
ToddHileHoffer14-Jan-11 4:50 
AnswerRe: SL, WPF, ASP.NET or ASP MVC Pin
Abhinav S13-Jan-11 5:59
Abhinav S13-Jan-11 5:59 
GeneralRe: SL, WPF, ASP.NET or ASP MVC Pin
ToddHileHoffer13-Jan-11 8:46
ToddHileHoffer13-Jan-11 8:46 
QuestionAdorners and ScrollViewer don't get along Pin
astibich210-Jan-11 8:45
astibich210-Jan-11 8:45 
I am using Adorners to show input errors on my textbox controls, and those controls are hosted within a ScrollViewer. For some reason, my adorner UI is clipped when it tries to draw outside the ScrollViewer.

I'm not the first to have this problem

http://social.msdn.microsoft.com/forums/en-US/wpf/thread/e060205e-5bfc-4f21-bf80-dfa55c44eb8a

However, the posted solution does not work for me... Has anyone else run into this problem?

Here's the XAML from my example project:

<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300" Loaded="Window_Loaded">
<Window.Resources>
<Style TargetType="{x:Type ScrollViewer}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ScrollViewer}">
<Grid x:Name="Grid" Background="{TemplateBinding Background}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Rectangle x:Name="Corner" Fill="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Grid.Column="1" Grid.Row="1"/>
<AdornerDecorator Grid.Column="0" Grid.Row="0">
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False"/>
</AdornerDecorator>
<ScrollBar x:Name="PART_VerticalScrollBar" Cursor="Arrow" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Grid.Column="1" Grid.Row="0" ViewportSize="{TemplateBinding ViewportHeight}" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Value="{Binding Path=VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" AutomationProperties.AutomationId="VerticalScrollBar"/>
<ScrollBar x:Name="PART_HorizontalScrollBar" Cursor="Arrow" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Grid.Column="0" Grid.Row="1" Orientation="Horizontal" ViewportSize="{TemplateBinding ViewportWidth}" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Value="{Binding Path=HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" AutomationProperties.AutomationId="HorizontalScrollBar"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<ScrollViewer Margin="50">
<TextBox Text="aaa" Height="23" Name="textBox1" Width="120" />
</ScrollViewer>
</Window>

I attach an adorner to the TextBox, but when that adorner draws outside the ScrollViewer window it gets clipped.

Thanks,

Aaron
AnswerRe: Adorners and ScrollViewer don't get along Pin
SledgeHammer0110-Jan-11 17:18
SledgeHammer0110-Jan-11 17:18 
GeneralRe: Adorners and ScrollViewer don't get along Pin
astibich211-Jan-11 11:07
astibich211-Jan-11 11:07 
GeneralRe: Adorners and ScrollViewer don't get along Pin
SledgeHammer0111-Jan-11 12:45
SledgeHammer0111-Jan-11 12:45 
GeneralRe: Adorners and ScrollViewer don't get along Pin
astibich211-Jan-11 13:18
astibich211-Jan-11 13:18 
GeneralRe: Adorners and ScrollViewer don't get along Pin
SledgeHammer0112-Jan-11 6:23
SledgeHammer0112-Jan-11 6:23 
Questionexpose windows service method to silverlight Pin
arkiboys10-Jan-11 6:18
arkiboys10-Jan-11 6:18 
AnswerRe: expose windows service method to silverlight Pin
Ray Cassick10-Jan-11 6:29
Ray Cassick10-Jan-11 6:29 
GeneralRe: expose windows service method to silverlight Pin
arkiboys10-Jan-11 10:24
arkiboys10-Jan-11 10:24 
QuestionSilver lights tools for Visual Studio 2008 [Solved] Pin
εїзεїзεїз8-Jan-11 19:22
εїзεїзεїз8-Jan-11 19:22 
AnswerRe: Silver lights tools for Visual Studio 2008 [Solved] Pin
εїзεїзεїз8-Jan-11 20:49
εїзεїзεїз8-Jan-11 20:49 
QuestionStop Multiple storyboards Pin
wlxl8-Jan-11 5:43
wlxl8-Jan-11 5:43 
AnswerRe: Stop Multiple storyboards Pin
Abhinav S8-Jan-11 20:59
Abhinav S8-Jan-11 20:59 
QuestionWPF, ASP.NET, Silverlight SSO Pin
javawizard@gmail.com7-Jan-11 6:09
javawizard@gmail.com7-Jan-11 6:09 
AnswerRe: WPF, ASP.NET, Silverlight SSO Pin
#realJSOP8-Jan-11 0:34
mve#realJSOP8-Jan-11 0:34 
AnswerRe: WPF, ASP.NET, Silverlight SSO Pin
RichardGrimmer10-Jan-11 4:00
RichardGrimmer10-Jan-11 4:00 
QuestionNeed Help: Is it possible to create such ComboBox UI? Pin
Kunal Chowdhury «IN»6-Jan-11 7:09
professionalKunal Chowdhury «IN»6-Jan-11 7:09 
AnswerRe: Need Help: Is it possible to create such ComboBox UI? Pin
SledgeHammer016-Jan-11 16:17
SledgeHammer016-Jan-11 16:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.