locked
Tooltips (sryan) - 2/5/2008 1:50 PM PST RRS feed

  • Question

  • By: sryan


    In my ResourceDictionary, I created a style to be applied to all of my 
    tooltips. That way they would have a nicer, vista-ish look instead the old 
    boring yellow box they've had for years. When I opened Blend and tried to 
    edit this style, however, I get the following error: 
    "InvalidOperationException: 'ToolTip' cannot have a logical or visual parent."
    
    If something is able to have a style applied to it, shouldn't I be able to 
    see that style in Blend so I can edit it? At the moment, I am forced to copy 
    the contents of that style and place them into a style of something that 
    isn't a tooltip just so I can make adjustments to it. Then when I'm done, I 
    paste it back into my ToolTip style.
    
    Friday, February 22, 2008 6:33 PM

Answers

  • By: Unni Ravindranathan


    This is something that we wanted to support, but did not have the time to
    fit it in. We have this on our list of things to enable for WPF. For now,
    the only workaround (which sucks to be honest) is to change the TargetType
    of the ToolTip to be of type ContentControl so you could edit it in the
    designer, and then change it back to ToolTip when you are done editing.

    Thanks,
    -Unni

    "sryan" <sryan@discussions.microsoft.com> wrote in message
    news:6647B559-BEA2-49BC-A8D7-7EF24DDD52AE@microsoft.com...
    > Why shouldn't Blend allow me to edit this style template? Surely if I am
    > allowed to apply a style to something I should be able to edit it. Where
    > else
    > but in Blend would I do that?
    >
    >
    > "Brennon Williams" wrote:
    >
    >> yeah now i see what you are saying..
    >>
    >> my issues is with referencing style templates from resources dictionaries
    >> which is why I originally thought you were seeing the same issue.
    >>
    >> I am not sure if Blend should allow you to modify this style template
    >> though
    >> as a reference to the control type "ToolTip". Certainly Blend shouldnt
    >> allow
    >> you to attempt to modify the template from the Resource panel in these
    >> particular cases.
    >>
    >> What is needed is a generic dummy presenter that allows you to attached
    >> any
    >> ControlTemplate for editing... which is what you are basically already
    >> doing.. just doing it the hardway..
    >>
    >>
    >> You could try something like the following that allows you to drag the
    >> ContentControl onto the form to style of edit the style directly for the
    >> tooltip.. this still isnt optimal.. but maybe better then what you are
    >> currently doing?
    >>
    >>
    >> <Window.Resources>
    >> <Style x:Key="ToolTipContentStyle1" TargetType="{x:Type ContentControl}">
    >> <Setter Property="Template">
    >> <Setter.Value>
    >> <ControlTemplate TargetType="{x:Type ContentControl}">
    >> <Grid Width="Auto" Height="Auto">
    >> <Border CornerRadius="5,5,5,5" BorderThickness="1,1,1,1"
    >> BorderBrush="#FFA3A3A3">
    >> <Border.Background>
    >> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    >> <GradientStop Color="#FF000000" Offset="0"/>
    >> <GradientStop Color="#FFFFFFFF" Offset="1"/>
    >> </LinearGradientBrush>
    >> </Border.Background>
    >> </Border>
    >> <ContentPresenter VerticalAlignment="Center" Height="Auto"
    >> HorizontalAlignment="Center"/>
    >> </Grid>
    >> </ControlTemplate>
    >> </Setter.Value>
    >> </Setter>
    >> <Setter Property="Foreground" Value="#FFCEFF00"/>
    >> <Setter Property="Width" Value="Auto"/>
    >> <Setter Property="Height" Value="Auto"/>
    >> <Setter Property="FontSize" Value="14"/>
    >> </Style>
    >>
    >>
    >> <Style TargetType="{x:Type ToolTip}">
    >> <Setter Property="OverridesDefaultStyle" Value="true"/>
    >> <Setter Property="VerticalOffset" Value="-2" />
    >> <Setter Property="HorizontalOffset" Value="20" />
    >> <Setter Property="Placement" Value="Top" />
    >> <Setter Property="Template">
    >> <Setter.Value>
    >> <ControlTemplate TargetType="{x:Type ToolTip}">
    >> <Grid Name="Border" Background="Transparent"
    >> Width="{TemplateBinding Width}" Height="60">
    >> <ContentControl HorizontalAlignment="Left" VerticalAlignment="Top"
    >> Height="41.059" Width="140.398" Style="{DynamicResource
    >> ToolTipContentStyle1}">
    >> <ContentPresenter />
    >> </ContentControl>
    >> </Grid>
    >> </ControlTemplate>
    >> </Setter.Value>
    >> </Setter>
    >> </Style>
    >>
    >>
    >> </Window.Resources>
    >> <Grid x:Name="LayoutRoot">
    >> <Button Content="Button" ToolTip="how about this?"
    >> HorizontalAlignment="Center" VerticalAlignment="Center"/>
    >> </Grid>
    >> </Window>
    >>
    >>
    >>
    >>
    >>
    >> --
    >> Want to learn how to use Blend and visual studio?
    >>
    >>
    http://www.learnexpressionstudio.com
    >> http://www.expressionblend.com
    >> http://www.x-coders.com
    >>
    >>
    >> "sryan" wrote:
    >>
    >> > I've used pack before but I've only used it in reference to get my xaml
    >> > or c#
    >> > to find other files (like getting a frame in my xaml to load an htm
    >> > file
    >> > that's local on the hard drive). However, I still don't see how using
    >> > pack
    >> > will get Blend to be able to open a Template so I can edit it. I mean
    >> > outside
    >> > of not being able to edit my template inside Blend like normal, the
    >> > template
    >> > itself works fine. The reason Blend gives for this isn't that it can't
    >> > find
    >> > it but because of the type of control a tooltip is. So, how does using
    >> > pack
    >> > fix that?
    >> >
    >> >
    >> > "Brennon Williams" wrote:
    >> >
    >> > > Howdy,
    >> > >
    >> > > There is lots to the pack syntax... this link should give you all the
    >> > > information you need:
    >> > >
    >> > >
    http://msdn2.microsoft.com/en-us/library/aa970069.aspx
    >> > >
    >> > > Cheers
    >> > > --
    >> > > Want to learn how to use Blend and visual studio?
    >> > >
    >> > >
    http://www.learnexpressionstudio.com
    >> > > http://www.expressionblend.com
    >> > > http://www.x-coders.com
    >> > >
    >> > >
    >> > > "sryan" wrote:
    >> > >
    >> > > > Not sure I follow. Where exactly would you use this "pack:///
    >> > > > component
    >> > > > syntax "?
    >> > > >
    >> > > >
    >> > > > "Brennon Williams" wrote:
    >> > > >
    >> > > > > Howdy,
    >> > > > >
    >> > > > > I just got some feedback from Unni through connect, where he
    >> > > > > correctly
    >> > > > > identifies my issue (hoping it is the same issues as yours) where
    >> > > > > by resource
    >> > > > > dicutionaries are referenced in two "control" projects.
    >> > > > >
    >> > > > >
    >> > > > > As Unni says, you need to use the pack:/// component syntax which
    >> > > > > is
    >> > > > > currently not supported very well in Blend but is something they
    >> > > > > are aware of
    >> > > > > and working on.
    >> > > > >
    >> > > > > HTH
    >> > > > >
    >> > > > > Cheers
    >> > > > >
    >> > > > > --
    >> > > > > Want to learn how to use Blend and visual studio?
    >> > > > >
    >> > > > >
    http://www.learnexpressionstudio.com
    >> > > > > http://www.expressionblend.com
    >> > > > > http://www.x-coders.com
    >> > > > >
    >> > > > >
    >> > > > > "Brennon Williams" wrote:
    >> > > > >
    >> > > > > > Howdy,
    >> > > > > >
    >> > > > > > I posted a similar defect to this yesterday with connect...
    >> > > > > > referenced
    >> > > > > > styles in resource dictionaries sometimes works and sometimes
    >> > > > > > doesnt..
    >> > > > > > depending on the control type...
    >> > > > > >
    >> > > > > > I will update you with any news I get on this.
    >> > > > > >
    >> > > > > > Cheers
    >> > > > > >
    >> > > > > > --
    >> > > > > > Want to learn how to use Blend and visual studio?
    >> > > > > >
    >> > > > > >
    http://www.learnexpressionstudio.com
    >> > > > > > http://www.expressionblend.com
    >> > > > > > http://www.x-coders.com
    >> > > > > >
    >> > > > > >
    >> > > > > > "sryan" wrote:
    >> > > > > >
    >> > > > > > > In my ResourceDictionary, I created a style to be applied to
    >> > > > > > > all of my
    >> > > > > > > tooltips. That way they would have a nicer, vista-ish look
    >> > > > > > > instead the old
    >> > > > > > > boring yellow box they've had for years. When I opened Blend
    >> > > > > > > and tried to
    >> > > > > > > edit this style, however, I get the following error:
    >> > > > > > > "InvalidOperationException: 'ToolTip' cannot have a logical
    >> > > > > > > or visual parent."
    >> > > > > > >
    >> > > > > > > If something is able to have a style applied to it, shouldn't
    >> > > > > > > I be able to
    >> > > > > > > see that style in Blend so I can edit it? At the moment, I am
    >> > > > > > > forced to copy
    >> > > > > > > the contents of that style and place them into a style of
    >> > > > > > > something that
    >> > > > > > > isn't a tooltip just so I can make adjustments to it. Then
    >> > > > > > > when I'm done, I
    >> > > > > > > paste it back into my ToolTip style.
    >> > > > > > >
    Monday, February 25, 2008 7:36 PM

All replies

  • By: Brennon Williams


    Howdy,
    
    I posted a similar defect to this yesterday with connect... referenced 
    styles in resource dictionaries sometimes works and sometimes doesnt.. 
    depending on the control type... 
    
    I will update you with any news I get on this.
    
    Cheers
    
    -- 
    Want to learn how to use Blend and visual studio?
    
    http://www.learnexpressionstudio.com
    http://www.expressionblend.com
    http://www.x-coders.com
    
    
    "sryan" wrote:
    
    > In my ResourceDictionary, I created a style to be applied to all of my 
    > tooltips. That way they would have a nicer, vista-ish look instead the old 
    > boring yellow box they've had for years. When I opened Blend and tried to 
    > edit this style, however, I get the following error: 
    > "InvalidOperationException: 'ToolTip' cannot have a logical or visual parent."
    > 
    > If something is able to have a style applied to it, shouldn't I be able to 
    > see that style in Blend so I can edit it? At the moment, I am forced to copy 
    > the contents of that style and place them into a style of something that 
    > isn't a tooltip just so I can make adjustments to it. Then when I'm done, I 
    > paste it back into my ToolTip style.
    > 
    Monday, February 25, 2008 6:56 PM
  • By: Brennon Williams


    Howdy,
    
    I just got some feedback from Unni through connect, where he correctly 
    identifies my issue (hoping it is the same issues as yours) where by resource 
    dicutionaries are referenced in two "control" projects.
    
    
    As Unni says, you need to use the pack:/// component syntax which is 
    currently not supported very well in Blend but is something they are aware of 
    and working on.
    
    HTH
    
    Cheers
    
    -- 
    Want to learn how to use Blend and visual studio?
    
    http://www.learnexpressionstudio.com
    http://www.expressionblend.com
    http://www.x-coders.com
    
    
    "Brennon Williams" wrote:
    
    > Howdy,
    > 
    > I posted a similar defect to this yesterday with connect... referenced 
    > styles in resource dictionaries sometimes works and sometimes doesnt.. 
    > depending on the control type... 
    > 
    > I will update you with any news I get on this.
    > 
    > Cheers
    > 
    > -- 
    > Want to learn how to use Blend and visual studio?
    > 
    > http://www.learnexpressionstudio.com
    > http://www.expressionblend.com
    > http://www.x-coders.com
    > 
    > 
    > "sryan" wrote:
    > 
    > > In my ResourceDictionary, I created a style to be applied to all of my 
    > > tooltips. That way they would have a nicer, vista-ish look instead the old 
    > > boring yellow box they've had for years. When I opened Blend and tried to 
    > > edit this style, however, I get the following error: 
    > > "InvalidOperationException: 'ToolTip' cannot have a logical or visual parent."
    > > 
    > > If something is able to have a style applied to it, shouldn't I be able to 
    > > see that style in Blend so I can edit it? At the moment, I am forced to copy 
    > > the contents of that style and place them into a style of something that 
    > > isn't a tooltip just so I can make adjustments to it. Then when I'm done, I 
    > > paste it back into my ToolTip style.
    > > 
    Monday, February 25, 2008 6:56 PM
  • By: sryan


    Not sure I follow. Where exactly would you use this "pack:/// component 
    syntax "?
    
    
    "Brennon Williams" wrote:
    
    > Howdy,
    > 
    > I just got some feedback from Unni through connect, where he correctly 
    > identifies my issue (hoping it is the same issues as yours) where by resource 
    > dicutionaries are referenced in two "control" projects.
    > 
    > 
    > As Unni says, you need to use the pack:/// component syntax which is 
    > currently not supported very well in Blend but is something they are aware of 
    > and working on.
    > 
    > HTH
    > 
    > Cheers
    > 
    > -- 
    > Want to learn how to use Blend and visual studio?
    > 
    > http://www.learnexpressionstudio.com
    > http://www.expressionblend.com
    > http://www.x-coders.com
    > 
    > 
    > "Brennon Williams" wrote:
    > 
    > > Howdy,
    > > 
    > > I posted a similar defect to this yesterday with connect... referenced 
    > > styles in resource dictionaries sometimes works and sometimes doesnt.. 
    > > depending on the control type... 
    > > 
    > > I will update you with any news I get on this.
    > > 
    > > Cheers
    > > 
    > > -- 
    > > Want to learn how to use Blend and visual studio?
    > > 
    > > http://www.learnexpressionstudio.com
    > > http://www.expressionblend.com
    > > http://www.x-coders.com
    > > 
    > > 
    > > "sryan" wrote:
    > > 
    > > > In my ResourceDictionary, I created a style to be applied to all of my 
    > > > tooltips. That way they would have a nicer, vista-ish look instead the old 
    > > > boring yellow box they've had for years. When I opened Blend and tried to 
    > > > edit this style, however, I get the following error: 
    > > > "InvalidOperationException: 'ToolTip' cannot have a logical or visual parent."
    > > > 
    > > > If something is able to have a style applied to it, shouldn't I be able to 
    > > > see that style in Blend so I can edit it? At the moment, I am forced to copy 
    > > > the contents of that style and place them into a style of something that 
    > > > isn't a tooltip just so I can make adjustments to it. Then when I'm done, I 
    > > > paste it back into my ToolTip style.
    > > > 
    Monday, February 25, 2008 6:57 PM
  • By: Brennon Williams


    Howdy,
    
    There is lots to the pack syntax... this link should give you all the 
    information you need:
    
    http://msdn2.microsoft.com/en-us/library/aa970069.aspx
    
    Cheers
    -- 
    Want to learn how to use Blend and visual studio?
    
    http://www.learnexpressionstudio.com
    http://www.expressionblend.com
    http://www.x-coders.com
    
    
    "sryan" wrote:
    
    > Not sure I follow. Where exactly would you use this "pack:/// component 
    > syntax "?
    > 
    > 
    > "Brennon Williams" wrote:
    > 
    > > Howdy,
    > > 
    > > I just got some feedback from Unni through connect, where he correctly 
    > > identifies my issue (hoping it is the same issues as yours) where by resource 
    > > dicutionaries are referenced in two "control" projects.
    > > 
    > > 
    > > As Unni says, you need to use the pack:/// component syntax which is 
    > > currently not supported very well in Blend but is something they are aware of 
    > > and working on.
    > > 
    > > HTH
    > > 
    > > Cheers
    > > 
    > > -- 
    > > Want to learn how to use Blend and visual studio?
    > > 
    > > http://www.learnexpressionstudio.com
    > > http://www.expressionblend.com
    > > http://www.x-coders.com
    > > 
    > > 
    > > "Brennon Williams" wrote:
    > > 
    > > > Howdy,
    > > > 
    > > > I posted a similar defect to this yesterday with connect... referenced 
    > > > styles in resource dictionaries sometimes works and sometimes doesnt.. 
    > > > depending on the control type... 
    > > > 
    > > > I will update you with any news I get on this.
    > > > 
    > > > Cheers
    > > > 
    > > > -- 
    > > > Want to learn how to use Blend and visual studio?
    > > > 
    > > > http://www.learnexpressionstudio.com
    > > > http://www.expressionblend.com
    > > > http://www.x-coders.com
    > > > 
    > > > 
    > > > "sryan" wrote:
    > > > 
    > > > > In my ResourceDictionary, I created a style to be applied to all of my 
    > > > > tooltips. That way they would have a nicer, vista-ish look instead the old 
    > > > > boring yellow box they've had for years. When I opened Blend and tried to 
    > > > > edit this style, however, I get the following error: 
    > > > > "InvalidOperationException: 'ToolTip' cannot have a logical or visual parent."
    > > > > 
    > > > > If something is able to have a style applied to it, shouldn't I be able to 
    > > > > see that style in Blend so I can edit it? At the moment, I am forced to copy 
    > > > > the contents of that style and place them into a style of something that 
    > > > > isn't a tooltip just so I can make adjustments to it. Then when I'm done, I 
    > > > > paste it back into my ToolTip style.
    > > > > 
    Monday, February 25, 2008 6:58 PM
  • By: sryan


    I've used pack before but I've only used it in reference to get my xaml or c# 
    to find other files (like getting a frame in my xaml to load an htm file 
    that's local on the hard drive). However, I still don't see how using pack 
    will get Blend to be able to open a Template so I can edit it. I mean outside 
    of not being able to edit my template inside Blend like normal, the template 
    itself works fine. The reason Blend gives for this isn't that it can't find 
    it but because of the type of control a tooltip is. So, how does using pack 
    fix that?
    
    
    "Brennon Williams" wrote:
    
    > Howdy,
    > 
    > There is lots to the pack syntax... this link should give you all the 
    > information you need:
    > 
    > http://msdn2.microsoft.com/en-us/library/aa970069.aspx
    > 
    > Cheers
    > -- 
    > Want to learn how to use Blend and visual studio?
    > 
    > http://www.learnexpressionstudio.com
    > http://www.expressionblend.com
    > http://www.x-coders.com
    > 
    > 
    > "sryan" wrote:
    > 
    > > Not sure I follow. Where exactly would you use this "pack:/// component 
    > > syntax "?
    > > 
    > > 
    > > "Brennon Williams" wrote:
    > > 
    > > > Howdy,
    > > > 
    > > > I just got some feedback from Unni through connect, where he correctly 
    > > > identifies my issue (hoping it is the same issues as yours) where by resource 
    > > > dicutionaries are referenced in two "control" projects.
    > > > 
    > > > 
    > > > As Unni says, you need to use the pack:/// component syntax which is 
    > > > currently not supported very well in Blend but is something they are aware of 
    > > > and working on.
    > > > 
    > > > HTH
    > > > 
    > > > Cheers
    > > > 
    > > > -- 
    > > > Want to learn how to use Blend and visual studio?
    > > > 
    > > > http://www.learnexpressionstudio.com
    > > > http://www.expressionblend.com
    > > > http://www.x-coders.com
    > > > 
    > > > 
    > > > "Brennon Williams" wrote:
    > > > 
    > > > > Howdy,
    > > > > 
    > > > > I posted a similar defect to this yesterday with connect... referenced 
    > > > > styles in resource dictionaries sometimes works and sometimes doesnt.. 
    > > > > depending on the control type... 
    > > > > 
    > > > > I will update you with any news I get on this.
    > > > > 
    > > > > Cheers
    > > > > 
    > > > > -- 
    > > > > Want to learn how to use Blend and visual studio?
    > > > > 
    > > > > http://www.learnexpressionstudio.com
    > > > > http://www.expressionblend.com
    > > > > http://www.x-coders.com
    > > > > 
    > > > > 
    > > > > "sryan" wrote:
    > > > > 
    > > > > > In my ResourceDictionary, I created a style to be applied to all of my 
    > > > > > tooltips. That way they would have a nicer, vista-ish look instead the old 
    > > > > > boring yellow box they've had for years. When I opened Blend and tried to 
    > > > > > edit this style, however, I get the following error: 
    > > > > > "InvalidOperationException: 'ToolTip' cannot have a logical or visual parent."
    > > > > > 
    > > > > > If something is able to have a style applied to it, shouldn't I be able to 
    > > > > > see that style in Blend so I can edit it? At the moment, I am forced to copy 
    > > > > > the contents of that style and place them into a style of something that 
    > > > > > isn't a tooltip just so I can make adjustments to it. Then when I'm done, I 
    > > > > > paste it back into my ToolTip style.
    > > > > > 
    Monday, February 25, 2008 7:02 PM
  • By: Brennon Williams


    yeah now i see what you are saying..
    
    my issues is with referencing style templates from resources dictionaries 
    which is why I originally thought you were seeing the same issue.
    
    I am not sure if Blend should allow you to modify this style template though 
    as a reference to the control type "ToolTip". Certainly Blend shouldnt allow 
    you to attempt to modify the template from the Resource panel in these 
    particular cases.
    
    What is needed is a generic dummy presenter that allows you to attached any 
    ControlTemplate for editing... which is what you are basically already 
    doing.. just doing it the hardway..
    
    
    You could try something like the following that allows you to drag the 
    ContentControl onto the form to style of edit the style directly for the 
    tooltip.. this still isnt optimal.. but maybe better then what you are 
    currently doing?
    
    
    <Window.Resources>
    	<Style x:Key="ToolTipContentStyle1" TargetType="{x:Type ContentControl}">
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="{x:Type ContentControl}">
    					<Grid Width="Auto" Height="Auto">
    						<Border CornerRadius="5,5,5,5" BorderThickness="1,1,1,1" 
    BorderBrush="#FFA3A3A3">
    							<Border.Background>
    								<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    									<GradientStop Color="#FF000000" Offset="0"/>
    									<GradientStop Color="#FFFFFFFF" Offset="1"/>
    								</LinearGradientBrush>
    							</Border.Background>
    						</Border>
    						<ContentPresenter VerticalAlignment="Center" Height="Auto" 
    HorizontalAlignment="Center"/>		
    					</Grid>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    		<Setter Property="Foreground" Value="#FFCEFF00"/>
    		<Setter Property="Width" Value="Auto"/>
    		<Setter Property="Height" Value="Auto"/>
    		<Setter Property="FontSize" Value="14"/>
    	</Style> 
    	
    	
    	<Style TargetType="{x:Type ToolTip}">
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="VerticalOffset" Value="-2" />
        <Setter Property="HorizontalOffset" Value="20" />
        <Setter Property="Placement" Value="Top" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToolTip}">
                    <Grid Name="Border" Background="Transparent" 
    Width="{TemplateBinding Width}" Height="60">
    					<ContentControl HorizontalAlignment="Left" VerticalAlignment="Top" 
    Height="41.059" Width="140.398" Style="{DynamicResource 
    ToolTipContentStyle1}">                
    						<ContentPresenter  />
    					</ContentControl>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style> 
    	
    	
    </Window.Resources>
    	<Grid x:Name="LayoutRoot">
    		<Button Content="Button" ToolTip="how about this?" 
    HorizontalAlignment="Center" VerticalAlignment="Center"/>
    	</Grid>
    </Window>
    
    
    
    
     
    -- 
    Want to learn how to use Blend and visual studio?
    
    http://www.learnexpressionstudio.com
    http://www.expressionblend.com
    http://www.x-coders.com
    
    
    "sryan" wrote:
    
    > I've used pack before but I've only used it in reference to get my xaml or c# 
    > to find other files (like getting a frame in my xaml to load an htm file 
    > that's local on the hard drive). However, I still don't see how using pack 
    > will get Blend to be able to open a Template so I can edit it. I mean outside 
    > of not being able to edit my template inside Blend like normal, the template 
    > itself works fine. The reason Blend gives for this isn't that it can't find 
    > it but because of the type of control a tooltip is. So, how does using pack 
    > fix that?
    > 
    > 
    > "Brennon Williams" wrote:
    > 
    > > Howdy,
    > > 
    > > There is lots to the pack syntax... this link should give you all the 
    > > information you need:
    > > 
    > > http://msdn2.microsoft.com/en-us/library/aa970069.aspx
    > > 
    > > Cheers
    > > -- 
    > > Want to learn how to use Blend and visual studio?
    > > 
    > > http://www.learnexpressionstudio.com
    > > http://www.expressionblend.com
    > > http://www.x-coders.com
    > > 
    > > 
    > > "sryan" wrote:
    > > 
    > > > Not sure I follow. Where exactly would you use this "pack:/// component 
    > > > syntax "?
    > > > 
    > > > 
    > > > "Brennon Williams" wrote:
    > > > 
    > > > > Howdy,
    > > > > 
    > > > > I just got some feedback from Unni through connect, where he correctly 
    > > > > identifies my issue (hoping it is the same issues as yours) where by resource 
    > > > > dicutionaries are referenced in two "control" projects.
    > > > > 
    > > > > 
    > > > > As Unni says, you need to use the pack:/// component syntax which is 
    > > > > currently not supported very well in Blend but is something they are aware of 
    > > > > and working on.
    > > > > 
    > > > > HTH
    > > > > 
    > > > > Cheers
    > > > > 
    > > > > -- 
    > > > > Want to learn how to use Blend and visual studio?
    > > > > 
    > > > > http://www.learnexpressionstudio.com
    > > > > http://www.expressionblend.com
    > > > > http://www.x-coders.com
    > > > > 
    > > > > 
    > > > > "Brennon Williams" wrote:
    > > > > 
    > > > > > Howdy,
    > > > > > 
    > > > > > I posted a similar defect to this yesterday with connect... referenced 
    > > > > > styles in resource dictionaries sometimes works and sometimes doesnt.. 
    > > > > > depending on the control type... 
    > > > > > 
    > > > > > I will update you with any news I get on this.
    > > > > > 
    > > > > > Cheers
    > > > > > 
    > > > > > -- 
    > > > > > Want to learn how to use Blend and visual studio?
    > > > > > 
    > > > > > http://www.learnexpressionstudio.com
    > > > > > http://www.expressionblend.com
    > > > > > http://www.x-coders.com
    > > > > > 
    > > > > > 
    > > > > > "sryan" wrote:
    > > > > > 
    > > > > > > In my ResourceDictionary, I created a style to be applied to all of my 
    > > > > > > tooltips. That way they would have a nicer, vista-ish look instead the old 
    > > > > > > boring yellow box they've had for years. When I opened Blend and tried to 
    > > > > > > edit this style, however, I get the following error: 
    > > > > > > "InvalidOperationException: 'ToolTip' cannot have a logical or visual parent."
    > > > > > > 
    > > > > > > If something is able to have a style applied to it, shouldn't I be able to 
    > > > > > > see that style in Blend so I can edit it? At the moment, I am forced to copy 
    > > > > > > the contents of that style and place them into a style of something that 
    > > > > > > isn't a tooltip just so I can make adjustments to it. Then when I'm done, I 
    > > > > > > paste it back into my ToolTip style.
    > > > > > > 
    Monday, February 25, 2008 7:34 PM
  • By: sryan


    Why shouldn't Blend allow me to edit this style template? Surely if I am 
    allowed to apply a style to something I should be able to edit it. Where else 
    but in Blend would I do that?
    
    
    "Brennon Williams" wrote:
    
    > yeah now i see what you are saying..
    > 
    > my issues is with referencing style templates from resources dictionaries 
    > which is why I originally thought you were seeing the same issue.
    > 
    > I am not sure if Blend should allow you to modify this style template though 
    > as a reference to the control type "ToolTip". Certainly Blend shouldnt allow 
    > you to attempt to modify the template from the Resource panel in these 
    > particular cases.
    > 
    > What is needed is a generic dummy presenter that allows you to attached any 
    > ControlTemplate for editing... which is what you are basically already 
    > doing.. just doing it the hardway..
    > 
    > 
    > You could try something like the following that allows you to drag the 
    > ContentControl onto the form to style of edit the style directly for the 
    > tooltip.. this still isnt optimal.. but maybe better then what you are 
    > currently doing?
    > 
    > 
    > <Window.Resources>
    > 	<Style x:Key="ToolTipContentStyle1" TargetType="{x:Type ContentControl}">
    > 		<Setter Property="Template">
    > 			<Setter.Value>
    > 				<ControlTemplate TargetType="{x:Type ContentControl}">
    > 					<Grid Width="Auto" Height="Auto">
    > 						<Border CornerRadius="5,5,5,5" BorderThickness="1,1,1,1" 
    > BorderBrush="#FFA3A3A3">
    > 							<Border.Background>
    > 								<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    > 									<GradientStop Color="#FF000000" Offset="0"/>
    > 									<GradientStop Color="#FFFFFFFF" Offset="1"/>
    > 								</LinearGradientBrush>
    > 							</Border.Background>
    > 						</Border>
    > 						<ContentPresenter VerticalAlignment="Center" Height="Auto" 
    > HorizontalAlignment="Center"/>		
    > 					</Grid>
    > 				</ControlTemplate>
    > 			</Setter.Value>
    > 		</Setter>
    > 		<Setter Property="Foreground" Value="#FFCEFF00"/>
    > 		<Setter Property="Width" Value="Auto"/>
    > 		<Setter Property="Height" Value="Auto"/>
    > 		<Setter Property="FontSize" Value="14"/>
    > 	</Style> 
    > 	
    > 	
    > 	<Style TargetType="{x:Type ToolTip}">
    >     <Setter Property="OverridesDefaultStyle" Value="true"/>
    >     <Setter Property="VerticalOffset" Value="-2" />
    >     <Setter Property="HorizontalOffset" Value="20" />
    >     <Setter Property="Placement" Value="Top" />
    >     <Setter Property="Template">
    >         <Setter.Value>
    >             <ControlTemplate TargetType="{x:Type ToolTip}">
    >                 <Grid Name="Border" Background="Transparent" 
    > Width="{TemplateBinding Width}" Height="60">
    > 					<ContentControl HorizontalAlignment="Left" VerticalAlignment="Top" 
    > Height="41.059" Width="140.398" Style="{DynamicResource 
    > ToolTipContentStyle1}">                
    > 						<ContentPresenter  />
    > 					</ContentControl>
    >                 </Grid>
    >             </ControlTemplate>
    >         </Setter.Value>
    >     </Setter>
    > </Style> 
    > 	
    > 	
    > </Window.Resources>
    > 	<Grid x:Name="LayoutRoot">
    > 		<Button Content="Button" ToolTip="how about this?" 
    > HorizontalAlignment="Center" VerticalAlignment="Center"/>
    > 	</Grid>
    > </Window>
    > 
    > 
    > 
    > 
    >  
    > -- 
    > Want to learn how to use Blend and visual studio?
    > 
    > http://www.learnexpressionstudio.com
    > http://www.expressionblend.com
    > http://www.x-coders.com
    > 
    > 
    > "sryan" wrote:
    > 
    > > I've used pack before but I've only used it in reference to get my xaml or c# 
    > > to find other files (like getting a frame in my xaml to load an htm file 
    > > that's local on the hard drive). However, I still don't see how using pack 
    > > will get Blend to be able to open a Template so I can edit it. I mean outside 
    > > of not being able to edit my template inside Blend like normal, the template 
    > > itself works fine. The reason Blend gives for this isn't that it can't find 
    > > it but because of the type of control a tooltip is. So, how does using pack 
    > > fix that?
    > > 
    > > 
    > > "Brennon Williams" wrote:
    > > 
    > > > Howdy,
    > > > 
    > > > There is lots to the pack syntax... this link should give you all the 
    > > > information you need:
    > > > 
    > > > http://msdn2.microsoft.com/en-us/library/aa970069.aspx
    > > > 
    > > > Cheers
    > > > -- 
    > > > Want to learn how to use Blend and visual studio?
    > > > 
    > > > http://www.learnexpressionstudio.com
    > > > http://www.expressionblend.com
    > > > http://www.x-coders.com
    > > > 
    > > > 
    > > > "sryan" wrote:
    > > > 
    > > > > Not sure I follow. Where exactly would you use this "pack:/// component 
    > > > > syntax "?
    > > > > 
    > > > > 
    > > > > "Brennon Williams" wrote:
    > > > > 
    > > > > > Howdy,
    > > > > > 
    > > > > > I just got some feedback from Unni through connect, where he correctly 
    > > > > > identifies my issue (hoping it is the same issues as yours) where by resource 
    > > > > > dicutionaries are referenced in two "control" projects.
    > > > > > 
    > > > > > 
    > > > > > As Unni says, you need to use the pack:/// component syntax which is 
    > > > > > currently not supported very well in Blend but is something they are aware of 
    > > > > > and working on.
    > > > > > 
    > > > > > HTH
    > > > > > 
    > > > > > Cheers
    > > > > > 
    > > > > > -- 
    > > > > > Want to learn how to use Blend and visual studio?
    > > > > > 
    > > > > > http://www.learnexpressionstudio.com
    > > > > > http://www.expressionblend.com
    > > > > > http://www.x-coders.com
    > > > > > 
    > > > > > 
    > > > > > "Brennon Williams" wrote:
    > > > > > 
    > > > > > > Howdy,
    > > > > > > 
    > > > > > > I posted a similar defect to this yesterday with connect... referenced 
    > > > > > > styles in resource dictionaries sometimes works and sometimes doesnt.. 
    > > > > > > depending on the control type... 
    > > > > > > 
    > > > > > > I will update you with any news I get on this.
    > > > > > > 
    > > > > > > Cheers
    > > > > > > 
    > > > > > > -- 
    > > > > > > Want to learn how to use Blend and visual studio?
    > > > > > > 
    > > > > > > http://www.learnexpressionstudio.com
    > > > > > > http://www.expressionblend.com
    > > > > > > http://www.x-coders.com
    > > > > > > 
    > > > > > > 
    > > > > > > "sryan" wrote:
    > > > > > > 
    > > > > > > > In my ResourceDictionary, I created a style to be applied to all of my 
    > > > > > > > tooltips. That way they would have a nicer, vista-ish look instead the old 
    > > > > > > > boring yellow box they've had for years. When I opened Blend and tried to 
    > > > > > > > edit this style, however, I get the following error: 
    > > > > > > > "InvalidOperationException: 'ToolTip' cannot have a logical or visual parent."
    > > > > > > > 
    > > > > > > > If something is able to have a style applied to it, shouldn't I be able to 
    > > > > > > > see that style in Blend so I can edit it? At the moment, I am forced to copy 
    > > > > > > > the contents of that style and place them into a style of something that 
    > > > > > > > isn't a tooltip just so I can make adjustments to it. Then when I'm done, I 
    > > > > > > > paste it back into my ToolTip style.
    > > > > > > > 
    Monday, February 25, 2008 7:35 PM
  • By: Unni Ravindranathan


    This is something that we wanted to support, but did not have the time to
    fit it in. We have this on our list of things to enable for WPF. For now,
    the only workaround (which sucks to be honest) is to change the TargetType
    of the ToolTip to be of type ContentControl so you could edit it in the
    designer, and then change it back to ToolTip when you are done editing.

    Thanks,
    -Unni

    "sryan" <sryan@discussions.microsoft.com> wrote in message
    news:6647B559-BEA2-49BC-A8D7-7EF24DDD52AE@microsoft.com...
    > Why shouldn't Blend allow me to edit this style template? Surely if I am
    > allowed to apply a style to something I should be able to edit it. Where
    > else
    > but in Blend would I do that?
    >
    >
    > "Brennon Williams" wrote:
    >
    >> yeah now i see what you are saying..
    >>
    >> my issues is with referencing style templates from resources dictionaries
    >> which is why I originally thought you were seeing the same issue.
    >>
    >> I am not sure if Blend should allow you to modify this style template
    >> though
    >> as a reference to the control type "ToolTip". Certainly Blend shouldnt
    >> allow
    >> you to attempt to modify the template from the Resource panel in these
    >> particular cases.
    >>
    >> What is needed is a generic dummy presenter that allows you to attached
    >> any
    >> ControlTemplate for editing... which is what you are basically already
    >> doing.. just doing it the hardway..
    >>
    >>
    >> You could try something like the following that allows you to drag the
    >> ContentControl onto the form to style of edit the style directly for the
    >> tooltip.. this still isnt optimal.. but maybe better then what you are
    >> currently doing?
    >>
    >>
    >> <Window.Resources>
    >> <Style x:Key="ToolTipContentStyle1" TargetType="{x:Type ContentControl}">
    >> <Setter Property="Template">
    >> <Setter.Value>
    >> <ControlTemplate TargetType="{x:Type ContentControl}">
    >> <Grid Width="Auto" Height="Auto">
    >> <Border CornerRadius="5,5,5,5" BorderThickness="1,1,1,1"
    >> BorderBrush="#FFA3A3A3">
    >> <Border.Background>
    >> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    >> <GradientStop Color="#FF000000" Offset="0"/>
    >> <GradientStop Color="#FFFFFFFF" Offset="1"/>
    >> </LinearGradientBrush>
    >> </Border.Background>
    >> </Border>
    >> <ContentPresenter VerticalAlignment="Center" Height="Auto"
    >> HorizontalAlignment="Center"/>
    >> </Grid>
    >> </ControlTemplate>
    >> </Setter.Value>
    >> </Setter>
    >> <Setter Property="Foreground" Value="#FFCEFF00"/>
    >> <Setter Property="Width" Value="Auto"/>
    >> <Setter Property="Height" Value="Auto"/>
    >> <Setter Property="FontSize" Value="14"/>
    >> </Style>
    >>
    >>
    >> <Style TargetType="{x:Type ToolTip}">
    >> <Setter Property="OverridesDefaultStyle" Value="true"/>
    >> <Setter Property="VerticalOffset" Value="-2" />
    >> <Setter Property="HorizontalOffset" Value="20" />
    >> <Setter Property="Placement" Value="Top" />
    >> <Setter Property="Template">
    >> <Setter.Value>
    >> <ControlTemplate TargetType="{x:Type ToolTip}">
    >> <Grid Name="Border" Background="Transparent"
    >> Width="{TemplateBinding Width}" Height="60">
    >> <ContentControl HorizontalAlignment="Left" VerticalAlignment="Top"
    >> Height="41.059" Width="140.398" Style="{DynamicResource
    >> ToolTipContentStyle1}">
    >> <ContentPresenter />
    >> </ContentControl>
    >> </Grid>
    >> </ControlTemplate>
    >> </Setter.Value>
    >> </Setter>
    >> </Style>
    >>
    >>
    >> </Window.Resources>
    >> <Grid x:Name="LayoutRoot">
    >> <Button Content="Button" ToolTip="how about this?"
    >> HorizontalAlignment="Center" VerticalAlignment="Center"/>
    >> </Grid>
    >> </Window>
    >>
    >>
    >>
    >>
    >>
    >> --
    >> Want to learn how to use Blend and visual studio?
    >>
    >>
    http://www.learnexpressionstudio.com
    >> http://www.expressionblend.com
    >> http://www.x-coders.com
    >>
    >>
    >> "sryan" wrote:
    >>
    >> > I've used pack before but I've only used it in reference to get my xaml
    >> > or c#
    >> > to find other files (like getting a frame in my xaml to load an htm
    >> > file
    >> > that's local on the hard drive). However, I still don't see how using
    >> > pack
    >> > will get Blend to be able to open a Template so I can edit it. I mean
    >> > outside
    >> > of not being able to edit my template inside Blend like normal, the
    >> > template
    >> > itself works fine. The reason Blend gives for this isn't that it can't
    >> > find
    >> > it but because of the type of control a tooltip is. So, how does using
    >> > pack
    >> > fix that?
    >> >
    >> >
    >> > "Brennon Williams" wrote:
    >> >
    >> > > Howdy,
    >> > >
    >> > > There is lots to the pack syntax... this link should give you all the
    >> > > information you need:
    >> > >
    >> > >
    http://msdn2.microsoft.com/en-us/library/aa970069.aspx
    >> > >
    >> > > Cheers
    >> > > --
    >> > > Want to learn how to use Blend and visual studio?
    >> > >
    >> > >
    http://www.learnexpressionstudio.com
    >> > > http://www.expressionblend.com
    >> > > http://www.x-coders.com
    >> > >
    >> > >
    >> > > "sryan" wrote:
    >> > >
    >> > > > Not sure I follow. Where exactly would you use this "pack:///
    >> > > > component
    >> > > > syntax "?
    >> > > >
    >> > > >
    >> > > > "Brennon Williams" wrote:
    >> > > >
    >> > > > > Howdy,
    >> > > > >
    >> > > > > I just got some feedback from Unni through connect, where he
    >> > > > > correctly
    >> > > > > identifies my issue (hoping it is the same issues as yours) where
    >> > > > > by resource
    >> > > > > dicutionaries are referenced in two "control" projects.
    >> > > > >
    >> > > > >
    >> > > > > As Unni says, you need to use the pack:/// component syntax which
    >> > > > > is
    >> > > > > currently not supported very well in Blend but is something they
    >> > > > > are aware of
    >> > > > > and working on.
    >> > > > >
    >> > > > > HTH
    >> > > > >
    >> > > > > Cheers
    >> > > > >
    >> > > > > --
    >> > > > > Want to learn how to use Blend and visual studio?
    >> > > > >
    >> > > > >
    http://www.learnexpressionstudio.com
    >> > > > > http://www.expressionblend.com
    >> > > > > http://www.x-coders.com
    >> > > > >
    >> > > > >
    >> > > > > "Brennon Williams" wrote:
    >> > > > >
    >> > > > > > Howdy,
    >> > > > > >
    >> > > > > > I posted a similar defect to this yesterday with connect...
    >> > > > > > referenced
    >> > > > > > styles in resource dictionaries sometimes works and sometimes
    >> > > > > > doesnt..
    >> > > > > > depending on the control type...
    >> > > > > >
    >> > > > > > I will update you with any news I get on this.
    >> > > > > >
    >> > > > > > Cheers
    >> > > > > >
    >> > > > > > --
    >> > > > > > Want to learn how to use Blend and visual studio?
    >> > > > > >
    >> > > > > >
    http://www.learnexpressionstudio.com
    >> > > > > > http://www.expressionblend.com
    >> > > > > > http://www.x-coders.com
    >> > > > > >
    >> > > > > >
    >> > > > > > "sryan" wrote:
    >> > > > > >
    >> > > > > > > In my ResourceDictionary, I created a style to be applied to
    >> > > > > > > all of my
    >> > > > > > > tooltips. That way they would have a nicer, vista-ish look
    >> > > > > > > instead the old
    >> > > > > > > boring yellow box they've had for years. When I opened Blend
    >> > > > > > > and tried to
    >> > > > > > > edit this style, however, I get the following error:
    >> > > > > > > "InvalidOperationException: 'ToolTip' cannot have a logical
    >> > > > > > > or visual parent."
    >> > > > > > >
    >> > > > > > > If something is able to have a style applied to it, shouldn't
    >> > > > > > > I be able to
    >> > > > > > > see that style in Blend so I can edit it? At the moment, I am
    >> > > > > > > forced to copy
    >> > > > > > > the contents of that style and place them into a style of
    >> > > > > > > something that
    >> > > > > > > isn't a tooltip just so I can make adjustments to it. Then
    >> > > > > > > when I'm done, I
    >> > > > > > > paste it back into my ToolTip style.
    >> > > > > > >
    Monday, February 25, 2008 7:36 PM
  • By: Brennon Williams


    Howdy Unni,
    
    Just for anyone else reading this, the work around to just change the 
    TargetType to ContentControl will not work if they have applied Property 
    Setters for VerticalOffset, HorizontalOffset and Placement in the ToolTip 
    Style.
    
    Of course you can remove these from the style, but then by default, the 
    tooltip will appear to the bottom right of the element.
    
    You could also cut and paste them or comment them out, but then you are 
    mucking around just as much as was one of Stacey's original complaints.
    
    I do believe the post I made previous to this is the only way to give any 
    easier access to the template at the present, certainly by using the 
    Resources panel, or is there any other way?
    
    Thanks for your input Unni.
    
    Cheers
    
    -- 
    Want to learn how to use Blend and visual studio?
    
    http://www.learnexpressionstudio.com
    http://www.expressionblend.com
    http://www.x-coders.com
    
    
    "Unni Ravindranathan" wrote:
    
    > This is something that we wanted to support, but did not have the time to 
    > fit it in. We have this on our list of things to enable for WPF. For now, 
    > the only workaround (which sucks to be honest) is to change the TargetType 
    > of the ToolTip to be of type ContentControl so you could edit it in the 
    > designer, and then change it back to ToolTip when you are done editing.
    > 
    > Thanks,
    > -Unni
    > 
    > "sryan" <sryan@discussions.microsoft.com> wrote in message 
    > news:6647B559-BEA2-49BC-A8D7-7EF24DDD52AE@microsoft.com...
    > > Why shouldn't Blend allow me to edit this style template? Surely if I am
    > > allowed to apply a style to something I should be able to edit it. Where 
    > > else
    > > but in Blend would I do that?
    > >
    > >
    > > "Brennon Williams" wrote:
    > >
    > >> yeah now i see what you are saying..
    > >>
    > >> my issues is with referencing style templates from resources dictionaries
    > >> which is why I originally thought you were seeing the same issue.
    > >>
    > >> I am not sure if Blend should allow you to modify this style template 
    > >> though
    > >> as a reference to the control type "ToolTip". Certainly Blend shouldnt 
    > >> allow
    > >> you to attempt to modify the template from the Resource panel in these
    > >> particular cases.
    > >>
    > >> What is needed is a generic dummy presenter that allows you to attached 
    > >> any
    > >> ControlTemplate for editing... which is what you are basically already
    > >> doing.. just doing it the hardway..
    > >>
    > >>
    > >> You could try something like the following that allows you to drag the
    > >> ContentControl onto the form to style of edit the style directly for the
    > >> tooltip.. this still isnt optimal.. but maybe better then what you are
    > >> currently doing?
    > >>
    > >>
    > >> <Window.Resources>
    > >> <Style x:Key="ToolTipContentStyle1" TargetType="{x:Type ContentControl}">
    > >> <Setter Property="Template">
    > >> <Setter.Value>
    > >> <ControlTemplate TargetType="{x:Type ContentControl}">
    > >> <Grid Width="Auto" Height="Auto">
    > >> <Border CornerRadius="5,5,5,5" BorderThickness="1,1,1,1"
    > >> BorderBrush="#FFA3A3A3">
    > >> <Border.Background>
    > >> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    > >> <GradientStop Color="#FF000000" Offset="0"/>
    > >> <GradientStop Color="#FFFFFFFF" Offset="1"/>
    > >> </LinearGradientBrush>
    > >> </Border.Background>
    > >> </Border>
    > >> <ContentPresenter VerticalAlignment="Center" Height="Auto"
    > >> HorizontalAlignment="Center"/>
    > >> </Grid>
    > >> </ControlTemplate>
    > >> </Setter.Value>
    > >> </Setter>
    > >> <Setter Property="Foreground" Value="#FFCEFF00"/>
    > >> <Setter Property="Width" Value="Auto"/>
    > >> <Setter Property="Height" Value="Auto"/>
    > >> <Setter Property="FontSize" Value="14"/>
    > >> </Style>
    > >>
    > >>
    > >> <Style TargetType="{x:Type ToolTip}">
    > >>     <Setter Property="OverridesDefaultStyle" Value="true"/>
    > >>     <Setter Property="VerticalOffset" Value="-2" />
    > >>     <Setter Property="HorizontalOffset" Value="20" />
    > >>     <Setter Property="Placement" Value="Top" />
    > >>     <Setter Property="Template">
    > >>         <Setter.Value>
    > >>             <ControlTemplate TargetType="{x:Type ToolTip}">
    > >>                 <Grid Name="Border" Background="Transparent"
    > >> Width="{TemplateBinding Width}" Height="60">
    > >> <ContentControl HorizontalAlignment="Left" VerticalAlignment="Top"
    > >> Height="41.059" Width="140.398" Style="{DynamicResource
    > >> ToolTipContentStyle1}">
    > >> <ContentPresenter  />
    > >> </ContentControl>
    > >>                 </Grid>
    > >>             </ControlTemplate>
    > >>         </Setter.Value>
    > >>     </Setter>
    > >> </Style>
    > >>
    > >>
    > >> </Window.Resources>
    > >> <Grid x:Name="LayoutRoot">
    > >> <Button Content="Button" ToolTip="how about this?"
    > >> HorizontalAlignment="Center" VerticalAlignment="Center"/>
    > >> </Grid>
    > >> </Window>
    > >>
    > >>
    > >>
    > >>
    > >>
    > >> -- 
    > >> Want to learn how to use Blend and visual studio?
    > >>
    > >> http://www.learnexpressionstudio.com
    > >> http://www.expressionblend.com
    > >> http://www.x-coders.com
    > >>
    > >>
    > >> "sryan" wrote:
    > >>
    > >> > I've used pack before but I've only used it in reference to get my xaml 
    > >> > or c#
    > >> > to find other files (like getting a frame in my xaml to load an htm 
    > >> > file
    > >> > that's local on the hard drive). However, I still don't see how using 
    > >> > pack
    > >> > will get Blend to be able to open a Template so I can edit it. I mean 
    > >> > outside
    > >> > of not being able to edit my template inside Blend like normal, the 
    > >> > template
    > >> > itself works fine. The reason Blend gives for this isn't that it can't 
    > >> > find
    > >> > it but because of the type of control a tooltip is. So, how does using 
    > >> > pack
    > >> > fix that?
    > >> >
    > >> >
    > >> > "Brennon Williams" wrote:
    > >> >
    > >> > > Howdy,
    > >> > >
    > >> > > There is lots to the pack syntax... this link should give you all the
    > >> > > information you need:
    > >> > >
    > >> > > http://msdn2.microsoft.com/en-us/library/aa970069.aspx
    > >> > >
    > >> > > Cheers
    > >> > > -- 
    > >> > > Want to learn how to use Blend and visual studio?
    > >> > >
    > >> > > http://www.learnexpressionstudio.com
    > >> > > http://www.expressionblend.com
    > >> > > http://www.x-coders.com
    > >> > >
    > >> > >
    > >> > > "sryan" wrote:
    > >> > >
    > >> > > > Not sure I follow. Where exactly would you use this "pack:/// 
    > >> > > > component
    > >> > > > syntax "?
    > >> > > >
    > >> > > >
    > >> > > > "Brennon Williams" wrote:
    > >> > > >
    > >> > > > > Howdy,
    > >> > > > >
    > >> > > > > I just got some feedback from Unni through connect, where he 
    > >> > > > > correctly
    > >> > > > > identifies my issue (hoping it is the same issues as yours) where 
    > >> > > > > by resource
    > >> > > > > dicutionaries are referenced in two "control" projects.
    > >> > > > >
    > >> > > > >
    > >> > > > > As Unni says, you need to use the pack:/// component syntax which 
    > >> > > > > is
    > >> > > > > currently not supported very well in Blend but is something they 
    > >> > > > > are aware of
    > >> > > > > and working on.
    > >> > > > >
    > >> > > > > HTH
    > >> > > > >
    > >> > > > > Cheers
    > >> > > > >
    > >> > > > > -- 
    > >> > > > > Want to learn how to use Blend and visual studio?
    > >> > > > >
    > >> > > > > http://www.learnexpressionstudio.com
    > >> > > > > http://www.expressionblend.com
    > >> > > > > http://www.x-coders.com
    > >> > > > >
    > >> > > > >
    > >> > > > > "Brennon Williams" wrote:
    > >> > > > >
    > >> > > > > > Howdy,
    > >> > > > > >
    > >> > > > > > I posted a similar defect to this yesterday with connect... 
    > >> > > > > > referenced
    > >> > > > > > styles in resource dictionaries sometimes works and sometimes 
    > >> > > > > > doesnt..
    > >> > > > > > depending on the control type...
    > >> > > > > >
    > >> > > > > > I will update you with any news I get on this.
    > >> > > > > >
    > >> > > > > > Cheers
    > >> > > > > >
    > >> > > > > > -- 
    > >> > > > > > Want to learn how to use Blend and visual studio?
    > >> > > > > >
    > >> > > > > > http://www.learnexpressionstudio.com
    > >> > > > > > http://www.expressionblend.com
    > >> > > > > > http://www.x-coders.com
    > >> > > > > >
    > >> > > > > >
    > >> > > > > > "sryan" wrote:
    > >> > > > > >
    > >> > > > > > > In my ResourceDictionary, I created a style to be applied to 
    > >> > > > > > > all of my
    > >> > > > > > > tooltips. That way they would have a nicer, vista-ish look 
    > >> > > > > > > instead the old
    > >> > > > > > > boring yellow box they've had for years. When I opened Blend 
    > >> > > > > > > and tried to
    > >> > > > > > > edit this style, however, I get the following error:
    > >> > > > > > > "InvalidOperationException: 'ToolTip' cannot have a logical 
    > >> > > > > > > or visual parent."
    > >> > > > > > >
    > >> > > > > > > If something is able to have a style applied to it, shouldn't 
    > >> > > > > > > I be able to
    > >> > > > > > > see that style in Blend so I can edit it? At the moment, I am 
    > >> > > > > > > forced to copy
    > >> > > > > > > the contents of that style and place them into a style of 
    > >> > > > > > > something that
    > >> > > > > > > isn't a tooltip just so I can make adjustments to it. Then 
    > >> > > > > > > when I'm done, I
    > >> > > > > > > paste it back into my ToolTip style.
    > >> > > > > > > 
    Monday, February 25, 2008 7:37 PM
  • By: Brennon Williams


    I guess it comes down to where you want the Blend product to be heading.. 
    what is placed as a priority and what isnt.
    
    I just think there are way more important parts of the whole 
    designer/developer story that need improving and are being considered, such 
    as contextual design and localisation support.
    
    For my money, the template styling features of Blend are pretty good, and I 
    think we can all mangage the odd bit of cut and paste.
    
    As i said previously, the only issue I see here is that the user is allowed 
    to attempt to modify the style from the Resources panel, which generates the 
    error.
    
    I truely hope the Blend team doesnt waste too much time on this, there are 
    more important things to get on with.
    
    -- 
    Want to learn how to use Blend and visual studio?
    
    http://www.learnexpressionstudio.com
    http://www.expressionblend.com
    http://www.x-coders.com
    
    
    "sryan" wrote:
    
    > Why shouldn't Blend allow me to edit this style template? Surely if I am 
    > allowed to apply a style to something I should be able to edit it. Where else 
    > but in Blend would I do that?
    > 
    > 
    > "Brennon Williams" wrote:
    > 
    > > yeah now i see what you are saying..
    > > 
    > > my issues is with referencing style templates from resources dictionaries 
    > > which is why I originally thought you were seeing the same issue.
    > > 
    > > I am not sure if Blend should allow you to modify this style template though 
    > > as a reference to the control type "ToolTip". Certainly Blend shouldnt allow 
    > > you to attempt to modify the template from the Resource panel in these 
    > > particular cases.
    > > 
    > > What is needed is a generic dummy presenter that allows you to attached any 
    > > ControlTemplate for editing... which is what you are basically already 
    > > doing.. just doing it the hardway..
    > > 
    > > 
    > > You could try something like the following that allows you to drag the 
    > > ContentControl onto the form to style of edit the style directly for the 
    > > tooltip.. this still isnt optimal.. but maybe better then what you are 
    > > currently doing?
    > > 
    > > 
    > > <Window.Resources>
    > > 	<Style x:Key="ToolTipContentStyle1" TargetType="{x:Type ContentControl}">
    > > 		<Setter Property="Template">
    > > 			<Setter.Value>
    > > 				<ControlTemplate TargetType="{x:Type ContentControl}">
    > > 					<Grid Width="Auto" Height="Auto">
    > > 						<Border CornerRadius="5,5,5,5" BorderThickness="1,1,1,1" 
    > > BorderBrush="#FFA3A3A3">
    > > 							<Border.Background>
    > > 								<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    > > 									<GradientStop Color="#FF000000" Offset="0"/>
    > > 									<GradientStop Color="#FFFFFFFF" Offset="1"/>
    > > 								</LinearGradientBrush>
    > > 							</Border.Background>
    > > 						</Border>
    > > 						<ContentPresenter VerticalAlignment="Center" Height="Auto" 
    > > HorizontalAlignment="Center"/>		
    > > 					</Grid>
    > > 				</ControlTemplate>
    > > 			</Setter.Value>
    > > 		</Setter>
    > > 		<Setter Property="Foreground" Value="#FFCEFF00"/>
    > > 		<Setter Property="Width" Value="Auto"/>
    > > 		<Setter Property="Height" Value="Auto"/>
    > > 		<Setter Property="FontSize" Value="14"/>
    > > 	</Style> 
    > > 	
    > > 	
    > > 	<Style TargetType="{x:Type ToolTip}">
    > >     <Setter Property="OverridesDefaultStyle" Value="true"/>
    > >     <Setter Property="VerticalOffset" Value="-2" />
    > >     <Setter Property="HorizontalOffset" Value="20" />
    > >     <Setter Property="Placement" Value="Top" />
    > >     <Setter Property="Template">
    > >         <Setter.Value>
    > >             <ControlTemplate TargetType="{x:Type ToolTip}">
    > >                 <Grid Name="Border" Background="Transparent" 
    > > Width="{TemplateBinding Width}" Height="60">
    > > 					<ContentControl HorizontalAlignment="Left" VerticalAlignment="Top" 
    > > Height="41.059" Width="140.398" Style="{DynamicResource 
    > > ToolTipContentStyle1}">                
    > > 						<ContentPresenter  />
    > > 					</ContentControl>
    > >                 </Grid>
    > >             </ControlTemplate>
    > >         </Setter.Value>
    > >     </Setter>
    > > </Style> 
    > > 	
    > > 	
    > > </Window.Resources>
    > > 	<Grid x:Name="LayoutRoot">
    > > 		<Button Content="Button" ToolTip="how about this?" 
    > > HorizontalAlignment="Center" VerticalAlignment="Center"/>
    > > 	</Grid>
    > > </Window>
    > > 
    > > 
    > > 
    > > 
    > >  
    > > -- 
    > > Want to learn how to use Blend and visual studio?
    > > 
    > > http://www.learnexpressionstudio.com
    > > http://www.expressionblend.com
    > > http://www.x-coders.com
    > > 
    > > 
    > > "sryan" wrote:
    > > 
    > > > I've used pack before but I've only used it in reference to get my xaml or c# 
    > > > to find other files (like getting a frame in my xaml to load an htm file 
    > > > that's local on the hard drive). However, I still don't see how using pack 
    > > > will get Blend to be able to open a Template so I can edit it. I mean outside 
    > > > of not being able to edit my template inside Blend like normal, the template 
    > > > itself works fine. The reason Blend gives for this isn't that it can't find 
    > > > it but because of the type of control a tooltip is. So, how does using pack 
    > > > fix that?
    > > > 
    > > > 
    > > > "Brennon Williams" wrote:
    > > > 
    > > > > Howdy,
    > > > > 
    > > > > There is lots to the pack syntax... this link should give you all the 
    > > > > information you need:
    > > > > 
    > > > > http://msdn2.microsoft.com/en-us/library/aa970069.aspx
    > > > > 
    > > > > Cheers
    > > > > -- 
    > > > > Want to learn how to use Blend and visual studio?
    > > > > 
    > > > > http://www.learnexpressionstudio.com
    > > > > http://www.expressionblend.com
    > > > > http://www.x-coders.com
    > > > > 
    > > > > 
    > > > > "sryan" wrote:
    > > > > 
    > > > > > Not sure I follow. Where exactly would you use this "pack:/// component 
    > > > > > syntax "?
    > > > > > 
    > > > > > 
    > > > > > "Brennon Williams" wrote:
    > > > > > 
    > > > > > > Howdy,
    > > > > > > 
    > > > > > > I just got some feedback from Unni through connect, where he correctly 
    > > > > > > identifies my issue (hoping it is the same issues as yours) where by resource 
    > > > > > > dicutionaries are referenced in two "control" projects.
    > > > > > > 
    > > > > > > 
    > > > > > > As Unni says, you need to use the pack:/// component syntax which is 
    > > > > > > currently not supported very well in Blend but is something they are aware of 
    > > > > > > and working on.
    > > > > > > 
    > > > > > > HTH
    > > > > > > 
    > > > > > > Cheers
    > > > > > > 
    > > > > > > -- 
    > > > > > > Want to learn how to use Blend and visual studio?
    > > > > > > 
    > > > > > > http://www.learnexpressionstudio.com
    > > > > > > http://www.expressionblend.com
    > > > > > > http://www.x-coders.com
    > > > > > > 
    > > > > > > 
    > > > > > > "Brennon Williams" wrote:
    > > > > > > 
    > > > > > > > Howdy,
    > > > > > > > 
    > > > > > > > I posted a similar defect to this yesterday with connect... referenced 
    > > > > > > > styles in resource dictionaries sometimes works and sometimes doesnt.. 
    > > > > > > > depending on the control type... 
    > > > > > > > 
    > > > > > > > I will update you with any news I get on this.
    > > > > > > > 
    > > > > > > > Cheers
    > > > > > > > 
    > > > > > > > -- 
    > > > > > > > Want to learn how to use Blend and visual studio?
    > > > > > > > 
    > > > > > > > http://www.learnexpressionstudio.com
    > > > > > > > http://www.expressionblend.com
    > > > > > > > http://www.x-coders.com
    > > > > > > > 
    > > > > > > > 
    > > > > > > > "sryan" wrote:
    > > > > > > > 
    > > > > > > > > In my ResourceDictionary, I created a style to be applied to all of my 
    > > > > > > > > tooltips. That way they would have a nicer, vista-ish look instead the old 
    > > > > > > > > boring yellow box they've had for years. When I opened Blend and tried to 
    > > > > > > > > edit this style, however, I get the following error: 
    > > > > > > > > "InvalidOperationException: 'ToolTip' cannot have a logical or visual parent."
    > > > > > > > > 
    > > > > > > > > If something is able to have a style applied to it, shouldn't I be able to 
    > > > > > > > > see that style in Blend so I can edit it? At the moment, I am forced to copy 
    > > > > > > > > the contents of that style and place them into a style of something that 
    > > > > > > > > isn't a tooltip just so I can make adjustments to it. Then when I'm done, I 
    > > > > > > > > paste it back into my ToolTip style.
    > > > > > > > > 
    Monday, February 25, 2008 7:38 PM