The question is not tied to any task, just wondering, I haven’t found an answer on the Internet yet. There are resources of the form:

<ResourceDictionary x:Class="resources_icons_xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <Canvas x:Key="appbar_3d_3ds" Width="76" Height="76" Clip="F1 M 0,0L 76,0L 76,76L 0,76L 0,0"> <Path Width="32" Height="40" Canvas.Left="23" Canvas.Top="18" Stretch="Fill" Fill="{DynamicResource BlackBrush}" Data="F1 M 27,18L 23,26L 33,30L 24,38L 33,46L 23,50L 27,58L 45,58L 55,38L 45,18L 27,18 Z "/> </Canvas> </ResourceDictionary> 

The dictionary is in a separate file, and apparently these are some kind of pictograms. I want to apply them to the button (menu item, just to the rectangle)

How and to what properties can they be applied?

  • In what sense are “resources”? What exactly do you want to achieve? Tell that. - VladD

1 answer 1

OK, for starters, you ca n't use your control so easily, since each control can have no more than one parent . You must write x:Shared="False" . Now you can use your resources with

 <ContentControl Content="{StaticResource appbar_3d_3ds}"/> 

But it’s actually more like a hack. It is better to arrange your XAML in a separate UserControl , or style, or DataTemplate , depending on what you really need this code for.

  • honestly for nothing. In one stub project, I saw this file, but it has not been applied anywhere yet, so it became interesting how, where and so on. Knowledge does not allow to immediately dig in the right direction, so I asked a question - Fony Fazoulyanov
  • @FonyFazoulyanov: Depending on what you need it for, there is a more suitable technique for this. And in general, yes, in theory, you can get to work with kicks. - VladD
  • Unfortunately, this project was created by the developer, which is not possible to contact. Maybe this file still needs something to add. Well, thank you very much for the answer. - Fony Fazoulyanov
  • @FonyFazoulyanov: Please! - VladD