Style BasedOn breaks when x:key is addedWhen to use struct?Does my code demonstrate good WPF practice?WPF change Button Content on ViewModel.PropertyChanged eventBasing A Style Off A Dynamic Resourcewhat does x:Key=“x:Type TextBox” do?wpf TreeViewItem BringIntoView does not always workDynamicResource for Style BasedOnTrying to access style info by StaticResource through ResourceDictionary with x:KeyHow to make style to extend but not override other stylesCannot base style on another style

What is the farthest a camera can see?

Why did Saruman lie?

How to find directories containing only specific files

How to remove ambiguity: "... lives in the city of H, the capital of the province of NS, WHERE the unemployment rate is ..."?

crippling fear of hellfire &, damnation, please help?

Why aren't rainbows blurred-out into nothing after they are produced?

How do some PhD students get 10+ papers? Is that what I need for landing good faculty position?

Why is the Lucas test not recommended to differentiate higher alcohols?

Update Office without opening an Office application

Boss wants me to ignore a software API license prohibiting mass download

Is it okay for a ticket seller to grab a tip in the USA?

Running code generated in realtime in JavaScript with eval()

Why aren’t there water shutoff valves for each room?

Are differences between uniformly distributed numbers uniformly distributed?

Modeling the uncertainty of the input parameters

Do I have to cite common CS algorithms?

Is there a SQL/English like language that lets you define formulations given some data?

Is this n-speak?

Can lodestones be used to magnetize crude iron weapons?

Are employers legally allowed to pay employees in goods and services equal to or greater than the minimum wage?

Why are Tucker and Malcolm not dead?

Website error: "Walmart can’t use this browser"

Why command hierarchy, if the chain of command is standing next to each other?

Programmatically add log information in all renderings(controller, view) html



Style BasedOn breaks when x:key is added


When to use struct?Does my code demonstrate good WPF practice?WPF change Button Content on ViewModel.PropertyChanged eventBasing A Style Off A Dynamic Resourcewhat does x:Key=“x:Type TextBox” do?wpf TreeViewItem BringIntoView does not always workDynamicResource for Style BasedOnTrying to access style info by StaticResource through ResourceDictionary with x:KeyHow to make style to extend but not override other stylesCannot base style on another style






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have user control which define custom style for the telerik's control RadTreeViewItem. The problem is that when I don't have x:key there isn't any errors but when I add the x:key property I've got error "The resource "RadTreeViewItemStyle" could not be resolved."



 <ResourceDictionary>
<Style x:Key="MySuperGoodStyle" TargetType="telerik:RadTreeViewItem" BasedOn="StaticResource RadTreeViewItemStyle">
<Setter Property="IsSelected" Value="Binding IsSelected, Mode=TwoWay" />
<Setter Property="IsExpanded" Value="Binding IsExpanded, Mode=TwoWay" />
</Style>
</ResourceDictionary>


In runtime there isn't any problems, the style works fine as expected so it looks like design only error.










share|improve this question






























    0















    I have user control which define custom style for the telerik's control RadTreeViewItem. The problem is that when I don't have x:key there isn't any errors but when I add the x:key property I've got error "The resource "RadTreeViewItemStyle" could not be resolved."



     <ResourceDictionary>
    <Style x:Key="MySuperGoodStyle" TargetType="telerik:RadTreeViewItem" BasedOn="StaticResource RadTreeViewItemStyle">
    <Setter Property="IsSelected" Value="Binding IsSelected, Mode=TwoWay" />
    <Setter Property="IsExpanded" Value="Binding IsExpanded, Mode=TwoWay" />
    </Style>
    </ResourceDictionary>


    In runtime there isn't any problems, the style works fine as expected so it looks like design only error.










    share|improve this question


























      0












      0








      0








      I have user control which define custom style for the telerik's control RadTreeViewItem. The problem is that when I don't have x:key there isn't any errors but when I add the x:key property I've got error "The resource "RadTreeViewItemStyle" could not be resolved."



       <ResourceDictionary>
      <Style x:Key="MySuperGoodStyle" TargetType="telerik:RadTreeViewItem" BasedOn="StaticResource RadTreeViewItemStyle">
      <Setter Property="IsSelected" Value="Binding IsSelected, Mode=TwoWay" />
      <Setter Property="IsExpanded" Value="Binding IsExpanded, Mode=TwoWay" />
      </Style>
      </ResourceDictionary>


      In runtime there isn't any problems, the style works fine as expected so it looks like design only error.










      share|improve this question














      I have user control which define custom style for the telerik's control RadTreeViewItem. The problem is that when I don't have x:key there isn't any errors but when I add the x:key property I've got error "The resource "RadTreeViewItemStyle" could not be resolved."



       <ResourceDictionary>
      <Style x:Key="MySuperGoodStyle" TargetType="telerik:RadTreeViewItem" BasedOn="StaticResource RadTreeViewItemStyle">
      <Setter Property="IsSelected" Value="Binding IsSelected, Mode=TwoWay" />
      <Setter Property="IsExpanded" Value="Binding IsExpanded, Mode=TwoWay" />
      </Style>
      </ResourceDictionary>


      In runtime there isn't any problems, the style works fine as expected so it looks like design only error.







      c# wpf xaml telerik






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 27 at 10:18









      Milen GrigorovMilen Grigorov

      8510 bronze badges




      8510 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          1














          try to add this before :



           <Style TargetType="telerik:RadTreeViewItem" x:Key="RadTreeViewItemStyle">
          <Setter Property="FocusVisualStyle" Value="StaticResource TreeviewFocusVisual"/>
          <Setter Property="HorizontalContentAlignment" Value="Left"/>
          <Setter Property="VerticalContentAlignment" Value="Center"/>
          <Setter Property="BorderThickness" Value="1"/>
          <Setter Property="Padding" Value="1 4 5 4"/>
          <Setter Property="MinHeight" Value="24"/>
          <Setter Property="IsDropAllowed" Value="True"/>
          <Setter Property="IsEnabled" Value="True"/>
          <Setter Property="IsTabStop" Value="False"/>
          <Setter Property="telerik:DragDropManager.TouchDragTrigger" Value="TapAndHold"/>
          <Setter Property="KeyboardNavigation.TabNavigation" Value="Local"/>
          <Setter Property="Template" Value="StaticResource TreeViewItemDefaultTemplate"/>
          <Setter Property="ItemsPanel">
          <Setter.Value>
          <ItemsPanelTemplate>
          <telerik:TreeViewPanel VerticalAlignment="Bottom"/>
          </ItemsPanelTemplate>
          </Setter.Value>
          </Setter>
          </Style>


          and be sure to have in your header :



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





          share|improve this answer

























          • Thanks for the help but it gave me error again. Anyway it looks like the bug fixes itself maybe it was bug in the VS and after restart it was fixed. I will give you best answer because you tried.

            – Milen Grigorov
            Mar 28 at 6:35










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55374792%2fstyle-basedon-breaks-when-xkey-is-added%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          try to add this before :



           <Style TargetType="telerik:RadTreeViewItem" x:Key="RadTreeViewItemStyle">
          <Setter Property="FocusVisualStyle" Value="StaticResource TreeviewFocusVisual"/>
          <Setter Property="HorizontalContentAlignment" Value="Left"/>
          <Setter Property="VerticalContentAlignment" Value="Center"/>
          <Setter Property="BorderThickness" Value="1"/>
          <Setter Property="Padding" Value="1 4 5 4"/>
          <Setter Property="MinHeight" Value="24"/>
          <Setter Property="IsDropAllowed" Value="True"/>
          <Setter Property="IsEnabled" Value="True"/>
          <Setter Property="IsTabStop" Value="False"/>
          <Setter Property="telerik:DragDropManager.TouchDragTrigger" Value="TapAndHold"/>
          <Setter Property="KeyboardNavigation.TabNavigation" Value="Local"/>
          <Setter Property="Template" Value="StaticResource TreeViewItemDefaultTemplate"/>
          <Setter Property="ItemsPanel">
          <Setter.Value>
          <ItemsPanelTemplate>
          <telerik:TreeViewPanel VerticalAlignment="Bottom"/>
          </ItemsPanelTemplate>
          </Setter.Value>
          </Setter>
          </Style>


          and be sure to have in your header :



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





          share|improve this answer

























          • Thanks for the help but it gave me error again. Anyway it looks like the bug fixes itself maybe it was bug in the VS and after restart it was fixed. I will give you best answer because you tried.

            – Milen Grigorov
            Mar 28 at 6:35















          1














          try to add this before :



           <Style TargetType="telerik:RadTreeViewItem" x:Key="RadTreeViewItemStyle">
          <Setter Property="FocusVisualStyle" Value="StaticResource TreeviewFocusVisual"/>
          <Setter Property="HorizontalContentAlignment" Value="Left"/>
          <Setter Property="VerticalContentAlignment" Value="Center"/>
          <Setter Property="BorderThickness" Value="1"/>
          <Setter Property="Padding" Value="1 4 5 4"/>
          <Setter Property="MinHeight" Value="24"/>
          <Setter Property="IsDropAllowed" Value="True"/>
          <Setter Property="IsEnabled" Value="True"/>
          <Setter Property="IsTabStop" Value="False"/>
          <Setter Property="telerik:DragDropManager.TouchDragTrigger" Value="TapAndHold"/>
          <Setter Property="KeyboardNavigation.TabNavigation" Value="Local"/>
          <Setter Property="Template" Value="StaticResource TreeViewItemDefaultTemplate"/>
          <Setter Property="ItemsPanel">
          <Setter.Value>
          <ItemsPanelTemplate>
          <telerik:TreeViewPanel VerticalAlignment="Bottom"/>
          </ItemsPanelTemplate>
          </Setter.Value>
          </Setter>
          </Style>


          and be sure to have in your header :



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





          share|improve this answer

























          • Thanks for the help but it gave me error again. Anyway it looks like the bug fixes itself maybe it was bug in the VS and after restart it was fixed. I will give you best answer because you tried.

            – Milen Grigorov
            Mar 28 at 6:35













          1












          1








          1







          try to add this before :



           <Style TargetType="telerik:RadTreeViewItem" x:Key="RadTreeViewItemStyle">
          <Setter Property="FocusVisualStyle" Value="StaticResource TreeviewFocusVisual"/>
          <Setter Property="HorizontalContentAlignment" Value="Left"/>
          <Setter Property="VerticalContentAlignment" Value="Center"/>
          <Setter Property="BorderThickness" Value="1"/>
          <Setter Property="Padding" Value="1 4 5 4"/>
          <Setter Property="MinHeight" Value="24"/>
          <Setter Property="IsDropAllowed" Value="True"/>
          <Setter Property="IsEnabled" Value="True"/>
          <Setter Property="IsTabStop" Value="False"/>
          <Setter Property="telerik:DragDropManager.TouchDragTrigger" Value="TapAndHold"/>
          <Setter Property="KeyboardNavigation.TabNavigation" Value="Local"/>
          <Setter Property="Template" Value="StaticResource TreeViewItemDefaultTemplate"/>
          <Setter Property="ItemsPanel">
          <Setter.Value>
          <ItemsPanelTemplate>
          <telerik:TreeViewPanel VerticalAlignment="Bottom"/>
          </ItemsPanelTemplate>
          </Setter.Value>
          </Setter>
          </Style>


          and be sure to have in your header :



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





          share|improve this answer













          try to add this before :



           <Style TargetType="telerik:RadTreeViewItem" x:Key="RadTreeViewItemStyle">
          <Setter Property="FocusVisualStyle" Value="StaticResource TreeviewFocusVisual"/>
          <Setter Property="HorizontalContentAlignment" Value="Left"/>
          <Setter Property="VerticalContentAlignment" Value="Center"/>
          <Setter Property="BorderThickness" Value="1"/>
          <Setter Property="Padding" Value="1 4 5 4"/>
          <Setter Property="MinHeight" Value="24"/>
          <Setter Property="IsDropAllowed" Value="True"/>
          <Setter Property="IsEnabled" Value="True"/>
          <Setter Property="IsTabStop" Value="False"/>
          <Setter Property="telerik:DragDropManager.TouchDragTrigger" Value="TapAndHold"/>
          <Setter Property="KeyboardNavigation.TabNavigation" Value="Local"/>
          <Setter Property="Template" Value="StaticResource TreeViewItemDefaultTemplate"/>
          <Setter Property="ItemsPanel">
          <Setter.Value>
          <ItemsPanelTemplate>
          <telerik:TreeViewPanel VerticalAlignment="Bottom"/>
          </ItemsPanelTemplate>
          </Setter.Value>
          </Setter>
          </Style>


          and be sure to have in your header :



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






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 27 at 11:14









          ilièsiliès

          292 bronze badges




          292 bronze badges















          • Thanks for the help but it gave me error again. Anyway it looks like the bug fixes itself maybe it was bug in the VS and after restart it was fixed. I will give you best answer because you tried.

            – Milen Grigorov
            Mar 28 at 6:35

















          • Thanks for the help but it gave me error again. Anyway it looks like the bug fixes itself maybe it was bug in the VS and after restart it was fixed. I will give you best answer because you tried.

            – Milen Grigorov
            Mar 28 at 6:35
















          Thanks for the help but it gave me error again. Anyway it looks like the bug fixes itself maybe it was bug in the VS and after restart it was fixed. I will give you best answer because you tried.

          – Milen Grigorov
          Mar 28 at 6:35





          Thanks for the help but it gave me error again. Anyway it looks like the bug fixes itself maybe it was bug in the VS and after restart it was fixed. I will give you best answer because you tried.

          – Milen Grigorov
          Mar 28 at 6:35








          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55374792%2fstyle-basedon-breaks-when-xkey-is-added%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript