Эксперт .NET
4432 / 2092 / 404
Регистрация: 27.03.2010
Сообщений: 5,657
Записей в блоге: 1
1

Не срабатывает PropertyChangedCallback в DependencyProperty

26.05.2014, 12:56. Показов 2560. Ответов 7
Метки нет (Все метки)

Author24 — интернет-сервис помощи студентам
Может кто-то объяснить почему не срабатывает этот колбек??? Иногда впечатление, что WPF живёт своей жизнью мне неведомой. Чуть не в тему, но к примеру, задаю у Label жёстко шрифт MT Mono, в дизайнере часы идут нормально с этим шрифтом, запускаю проект, там другой шрифт. ВТФ???
XML
1
2
3
4
5
6
7
<buttons:ExButton Width="26"
       Height="26"
       Margin="0,0,0,0"
       MouseHoverStateImageSource="pack://application:,,,/XXX.Resources;component/Pictures/States/Buttons/Plus/icon_plus_over.png"
       NormalStateImageSource="pack://application:,,,/XXX.Resources;component/Pictures/States/Buttons/Plus/icon_plus.png"
       PressedStateImageSource="pack://application:,,,/XXX.Resources;component/Pictures/States/Buttons/Plus/icon_plus_press.png"
       ToolTip="Создать заявку" />
C#
1
2
3
4
5
6
7
    public enum ButtonState
    {
        Normal,
        MouseHover,
        Pressed
    }
}
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
    public class ExButton : Button
    {
        public ExButton()
        {
            State = ButtonState.Normal; //Знаю, что лишнее, но для теста надо было
        }
 
        public static readonly DependencyProperty NormalStateImageSourceProperty = DependencyProperty.Register(
            "NormalStateImageSource",
            typeof(ImageSource), typeof(ExButton), (PropertyMetadata)new FrameworkPropertyMetadata((object)null,
                FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender,
                null, (CoerceValueCallback)null), (ValidateValueCallback)null);
 
        public static readonly DependencyProperty MouseHoverStateImageSourceProperty = DependencyProperty.Register(
            "MouseHoverStateImageSource", typeof(ImageSource), typeof(ExButton), (PropertyMetadata)new FrameworkPropertyMetadata((object)null,
                FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender,
                null, (CoerceValueCallback)null), (ValidateValueCallback)null);
 
        public static readonly DependencyProperty PressedStateImageSourceProperty = DependencyProperty.Register(
            "PressedStateImageSource", typeof(ImageSource), typeof(ExButton), (PropertyMetadata)new FrameworkPropertyMetadata((object)null,
                FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender,
                null, (CoerceValueCallback)null), (ValidateValueCallback)null);
 
 
        public static readonly DependencyProperty StateProperty = DependencyProperty.Register(
            "State", typeof (ButtonState), typeof (ExButton), new PropertyMetadata(default(ButtonState),
                new PropertyChangedCallback(StateChangedCallback)));
 
        private static void StateChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var button = (ExButton) d;
            switch ((ButtonState)e.NewValue)
            {
                case ButtonState.Normal:
                    button.Content = button.NormalStateImageSource;
                    break;
                case ButtonState.MouseHover:
                    button.Content = button.MouseHoverStateImageSource;
                    break;
                case ButtonState.Pressed:
                    button.Content = button.PressedStateImageSource;
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }
        }
 
        public ButtonState State
        {
            get { return (ButtonState) GetValue(StateProperty); }
            set { SetValue(StateProperty, value); }
        }
 
        public ImageSource NormalStateImageSource
        {
            get { return (ImageSource)GetValue(NormalStateImageSourceProperty); }
            set { SetValue(NormalStateImageSourceProperty, value); }
        }
 
        public ImageSource MouseHoverStateImageSource
        {
            get { return (ImageSource)GetValue(MouseHoverStateImageSourceProperty); }
            set { SetValue(MouseHoverStateImageSourceProperty, value); }
        }
 
        public ImageSource PressedStateImageSource
        {
            get { return (ImageSource)GetValue(PressedStateImageSourceProperty); }
            set { SetValue(PressedStateImageSourceProperty, value); }
        }
    }
0
Programming
Эксперт
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
26.05.2014, 12:56
Ответы с готовыми решениями:

DependencyProperty
Как правильно зарегистрировать вот такое свойство Используется для прямоугольника(rectangle) в...

Не работают DependencyProperty
Здравствуйте. Я пытаюсь привязать свойство типа стринг к контролу Label но оно не отображается на...

DependencyProperty для ItemsControl
В одном из предыдущих постов Элд Хасп посоветовал переделать INPC на DP. У меня было: ...

Как использовать DependencyProperty
Добрый день. Не могу понять эту тему. Как создавать понимаю, а как использовать - нет. Тоесть в...

7
995 / 893 / 354
Регистрация: 24.03.2014
Сообщений: 2,381
Записей в блоге: 2
26.05.2014, 13:42 2
Casper-SC, вообще не отрабатывает или в нужный момент?
0
Эксперт .NET
4432 / 2092 / 404
Регистрация: 27.03.2010
Сообщений: 5,657
Записей в блоге: 1
26.05.2014, 13:57  [ТС] 3
Spawn, вообще. Ставлю точки останова, не заходит в колбек.
0
Эксперт .NET
4432 / 2092 / 404
Регистрация: 27.03.2010
Сообщений: 5,657
Записей в блоге: 1
26.05.2014, 14:01  [ТС] 4
А вот магия шрифтов. В коде нет ничего меняющего шрифт в зависимости от того в дизайнере ли отображается сейчас окно, вообще нет такой логики нигде меняющей что-то из-за отображения в дизайнере.

MT Mono в дизанере
Название: Screenshot_10.jpg
Просмотров: 75

Размер: 18.6 Кб

Хитрый WPF поставил в релиз то, что ему больше по душе
Название: Screenshot_11.jpg
Просмотров: 75

Размер: 11.3 Кб
0
995 / 893 / 354
Регистрация: 24.03.2014
Сообщений: 2,381
Записей в блоге: 2
26.05.2014, 14:17 5
Так, гм, со свойством всё нормально... Если у Вас не заходит на строке
Цитата Сообщение от Casper-SC Посмотреть сообщение
State = ButtonState.Normal; //Знаю, что лишнее, но для теста надо было
то и не зайдёт, так как значение по-умолчанию совпадает с задаваемым значением...
Элементарный кусок отлично работает...
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
        public State MyState
        {
            get { return (State)GetValue(MyStateProperty); }
            set { SetValue(MyStateProperty, value); }
        }
 
        // Using a DependencyProperty as the backing store for MyState.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty MyStateProperty =
            DependencyProperty.Register("MyState", typeof(State), typeof(MainWindow), new PropertyMetadata(default(State), new PropertyChangedCallback(callback)));
 
        private static void callback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            // we are here
        }
 
        
        public MainWindow()
        {
            InitializeComponent();
            MyState = State.Normal;
        }
C#
1
2
3
4
5
    public enum State
    {
        Normal,
        Something
    }
С шрифтами сейчас гляну.

Добавлено через 2 минуты
Casper-SC, что касается шрифтов, XAML можно? Не переопределяются ли стили, например в XAML, анимация какая с проблемным элементом? Font, как известно, наследуется от родительских элементов управления, что присуще не очень многим свойствам.
0
Эксперт .NET
4432 / 2092 / 404
Регистрация: 27.03.2010
Сообщений: 5,657
Записей в блоге: 1
26.05.2014, 14:23  [ТС] 6
XML
1
2
3
4
5
6
7
8
9
10
  <!--  Стиль для меток обрамлённых границей для отображения на главном экране (по первоначальной задумке)  -->
  <Style x:Key="DefaultLabelStyle"
         TargetType="Label">
    <Setter Property="FontFamily" Value="PT Mono" />
    <Setter Property="Foreground" Value="{StaticResource DefaultBrushForText}" />
    <Setter Property="HorizontalContentAlignment" Value="Center" />
    <Setter Property="BorderBrush" Value="{StaticResource LabelBorderBrush}" />
    <Setter Property="BorderThickness" Value="1" />
    <Setter Property="Padding" Value="2" />
  </Style>
XML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
<Window x:Class="Client.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:buttons="clr-namespace:XXX.Controls.UIElements.Buttons;assembly=XXX.Controls"
        xmlns:system="clr-namespace:System;assembly=mscorlib"
        xmlns:uiElements="clr-namespace:XXX.Controls.UIElements;assembly=XXX.Controls"
        xmlns:validationRules="clr-namespace:XXX.Utils.ValidationRules;assembly=XXX.Utils"
        Title="MainWindow"
        Width="800"
        Height="670.275"
        Background="{StaticResource BackgroundMainWindowBrushKey}"
        Closing="Window_Closing"
        DataContext="{Binding Source={StaticResource Locator},
                              Path=Main}"
        Loaded="Window_Loaded"
        TextOptions.TextFormattingMode="Display"
        TextOptions.TextRenderingMode="ClearType"
        WindowStartupLocation="CenterScreen">
 
  <Grid>
    <TextBox Width="120"
             Height="23"
             Margin="199,364,0,0"
             HorizontalAlignment="Left"
             VerticalAlignment="Top"
             TextWrapping="Wrap">
      <TextBox.Resources>
        <system:String x:Key="FloatValuesRegexKey">[^0-9\\.,]+</system:String>
      </TextBox.Resources>
      <TextBox.Text>
        <Binding Mode="TwoWay"
                 Path="TestValue"
                 UpdateSourceTrigger="PropertyChanged">
          <Binding.ValidationRules>
            <validationRules:RegexValidationRule ErrorMessage="Можно вводить только цифры и десятичный разделить"
                                                 Pattern="{StaticResource FloatValuesRegexKey}" />
          </Binding.ValidationRules>
        </Binding>
      </TextBox.Text>
    </TextBox>
    <Button Width="75"
            Margin="10,44,0,0"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            Click="Button_Click_2"
            Content="Проверить" />
    <Button Width="72"
            Height="68"
            Margin="13,513,0,0"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            Click="Button_Click_3"
            Content="Проверить"
            Style="{DynamicResource PolygonButtonStyle}" />
    <Button x:Name="recepiesEditorButton"
            Width="124"
            Margin="105,44,0,0"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            Command="{Binding OpenRecipesEditorCommand}"
            Content="Редактор рецептов" />
 
    <Grid Width="340"
          Margin="2"
          HorizontalAlignment="Right"
          DataContext="{Binding Source={StaticResource Locator},
                                Path=ApplicationsEditor}">
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="77*" />
        <RowDefinition Height="76*" />
        <RowDefinition Height="Auto" />
      </Grid.RowDefinitions>
      <GroupBox Grid.Row="1"
                Margin="0,6,0,3"
                Header="Заявки"
                Style="{DynamicResource BeveledGroupBoxWithBottomPanelStyle}">
 
        <Grid>
          <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="36" />
          </Grid.RowDefinitions>
 
          <!--  ItemsSource="{Binding Source={StaticResource Locator}, Path=ApplicationsEditor.RootElements}"  -->
          <DataGrid x:Name="appsDataGrid"
                    Margin="1,0"
                    AutoGenerateColumns="False"
                    DataContext="{Binding Path=ApplicationsEditor,
                                          Source={StaticResource Locator}}"
                    ItemsSource="{Binding Path=RootElements}"
                    SelectedIndex="{Binding Path=ElementsSelectedIndex,
                                            Mode=TwoWay}"
                    SelectionMode="Single"
                    Style="{StaticResource DataGridStyle}">
            <DataGrid.Columns>
              <DataGridTextColumn x:Name="AppNumberColumn"
                                  Binding="{Binding Path=Id}"
                                  ClipboardContentBinding="{x:Null}"
                                  Header="№" />
              <DataGridTextColumn x:Name="RecipeNameColumn"
                                  Binding="{Binding Path=Recipe.Name}"
                                  ClipboardContentBinding="{x:Null}"
                                  Header="Рецепт" />
              <DataGridTextColumn x:Name="MixerNumberColumn"
                                  Binding="{Binding Path=MixerNumber}"
                                  ClipboardContentBinding="{x:Null}"
                                  Header="Смеситель" />
              <DataGridTextColumn x:Name="StatusColumn"
                                  ClipboardContentBinding="{x:Null}"
                                  Header="Выполнено">
                <DataGridTextColumn.Binding>
                  <MultiBinding StringFormat="{}{0:F}/{1:F} м3">
                    <Binding Path="VolumeCurrent" />
                    <Binding Path="Volume" />
                  </MultiBinding>
                </DataGridTextColumn.Binding>
              </DataGridTextColumn>
            </DataGrid.Columns>
          </DataGrid>
 
          <Grid Grid.Row="2">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="1*" />
              <ColumnDefinition Width="1*" />
              <ColumnDefinition Width="1*" />
            </Grid.ColumnDefinitions>
 
            <StackPanel Grid.Column="0"
                        Margin="3,0,0,0"
                        Orientation="Horizontal">
              <buttons:ExButton Width="26"
                                Height="26"
                                Margin="0,0,0,0"
                                Command="{Binding CreateApplicationCommand}"
                                MouseHoverStateImageSource="pack://application:,,,/XXX.Resources;component/Pictures/States/Buttons/Plus/icon_plus_over.png"
                                NormalStateImageSource="pack://application:,,,/XXX.Resources;component/Pictures/States/Buttons/Plus/icon_plus.png"
                                PressedStateImageSource="pack://application:,,,/XXX.Resources;component/Pictures/States/Buttons/Plus/icon_plus_press.png"
                                ToolTip="Создать заявку" />
              <Button Width="26"
                      Height="26"
                      Margin="3,0,0,0"
                      Command="{Binding EditApplicationCommand}"
                      ToolTip="Удалить заявку" />
              <Button Width="26"
                      Height="26"
                      Margin="3,0,0,0"
                      Command="{Binding RemoveApplicationCommand}"
                      ToolTip="Редактировать" />
            </StackPanel>
            <StackPanel Grid.Column="1"
                        HorizontalAlignment="Center"
                        Orientation="Horizontal">
              <Button Width="26"
                      Height="26"
                      Margin="3,0,0,0"
                      Command="{Binding MoveAppDownCommand}"
                      ToolTip="Сместить в очереди на одну позицию ниже" />
              <Button Width="26"
                      Height="26"
                      Margin="3,0,0,0"
                      Command="{Binding MoveAppUpCommand}"
                      ToolTip="Сместить в очереди на одну позицию выше" />
            </StackPanel>
            <StackPanel Grid.Column="2"
                        Margin="0,0,3,0"
                        HorizontalAlignment="Right"
                        Orientation="Horizontal">
              <Button Width="26"
                      Height="26"
                      Margin="3,0,0,0"
                      Command="{Binding StopExecutionCommand}"
                      ToolTip="Остановить выполнение" />
              <Button Width="26"
                      Height="26"
                      Margin="3,0,0,0"
                      Command="{Binding StartExecutionCommand}"
                      ToolTip="Запустить выполнение" />
            </StackPanel>
          </Grid>
        </Grid>
      </GroupBox>
      <GroupBox Grid.Row="2"
                Width="343"
                Margin="3,3,0,3"
                HorizontalAlignment="Right"
                Header="Подробности"
                Style="{DynamicResource BeveledGroupBoxWithBottomPanelStyle}">
        <Grid>
          <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="36" />
          </Grid.RowDefinitions>
          <ScrollViewer VerticalScrollBarVisibility="Auto">
            <Grid Margin="3"
                  DataContext="{Binding ElementName=appsDataGrid,
                                        Path=SelectedItem}">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*" />
                <ColumnDefinition Width="1*" />
              </Grid.ColumnDefinitions>
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <!--
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="Auto" />
                -->
              </Grid.RowDefinitions>
              <TextBox Grid.Row="0"
                       Grid.Column="0"
                       Style="{StaticResource DetailsCellStyle}"
                       Text="Объём" />
              <TextBox Grid.Row="0"
                       Grid.Column="1"
                       Style="{StaticResource DetailsCellStyle}"
                       Text="{Binding Volume}" />
              <TextBox Grid.Row="1"
                       Grid.Column="0"
                       Style="{StaticResource DetailsCellStyle}"
                       Text="Смеситель" />
              <TextBox Grid.Row="1"
                       Grid.Column="1"
                       Style="{StaticResource DetailsCellStyle}"
                       Text="{Binding MixerNumber}" />
              <TextBox Grid.Row="2"
                       Grid.Column="0"
                       Style="{StaticResource DetailsCellStyle}"
                       Text="Заказчик" />
              <TextBox Grid.Row="2"
                       Grid.Column="1"
                       Style="{StaticResource DetailsCellStyle}"
                       Text="{Binding Client.Name}" />
              <TextBox Grid.Row="3"
                       Grid.Column="0"
                       Style="{StaticResource DetailsCellStyle}"
                       Text="Машина" />
              <TextBox Grid.Row="3"
                       Grid.Column="1"
                       Style="{StaticResource DetailsCellStyle}"
                       Text="{Binding Car.CarNumber}" />
              <TextBox Grid.Row="4"
                       Grid.Column="0"
                       Style="{StaticResource DetailsCellStyle}"
                       Text="Рецепт" />
              <TextBox Grid.Row="4"
                       Grid.Column="1"
                       Style="{StaticResource DetailsCellStyle}"
                       Text="{Binding Recipe.Name}" />
              <TextBox Grid.Row="5"
                       Grid.Column="0"
                       Style="{StaticResource DetailsCellStyle}"
                       Text="Выполнено" />
              <TextBox Grid.Row="5"
                       Grid.Column="1"
                       Style="{StaticResource DetailsCellStyle}">
                <TextBox.Text>
                  <MultiBinding StringFormat="{}{0:F}/{1:F} м3">
                    <Binding Path="VolumeCurrent" />
                    <Binding Path="Volume" />
                  </MultiBinding>
                </TextBox.Text>
              </TextBox>
              <!--
                <TextBox Grid.Row="6"
                Grid.Column="0"
                Style="{StaticResource DetailsCellStyle}"
                Text="" />
                <TextBox Grid.Row="6"
                Grid.Column="1"
                Style="{StaticResource DetailsCellStyle}"
                Text="" />
                <TextBox Grid.Row="7"
                Grid.Column="0"
                Style="{StaticResource DetailsCellStyle}"
                Text="" />
                <TextBox Grid.Row="7"
                Grid.Column="1"
                Style="{StaticResource DetailsCellStyle}"
                Text="" />
                <TextBox Grid.Row="8"
                Grid.Column="0"
                Style="{StaticResource DetailsCellStyle}"
                Text="" />
                <TextBox Grid.Row="8"
                Grid.Column="1"
                Style="{StaticResource DetailsCellStyle}"
                Text="" />
                <TextBox Grid.Row="9"
                Grid.Column="0"
                Style="{StaticResource DetailsCellStyle}"
                Text="" />
                <TextBox Grid.Row="9"
                Grid.Column="1"
                Style="{StaticResource DetailsCellStyle}"
                Text="" />
              -->
 
              <Grid Grid.Row="11"
                    Grid.ColumnSpan="2"
                    ShowGridLines="True" />
            </Grid>
          </ScrollViewer>
        </Grid>
      </GroupBox>
      <Grid Grid.Row="0"
            DataContext="{Binding Source={StaticResource Locator},
                                  Path=Main}">
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto" />
          <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Image Margin="6"
               Source="pack://application:,,,/XXX.Resources;component/Pictures/UI/Logos/MainLogo_1.png"
               Stretch="None" />
        <Border Grid.Row="0"
                Grid.RowSpan="2"
                BorderBrush="{DynamicResource Button.Static.Border}"
                BorderThickness="1" />
        <Border Grid.Row="1"
                Background="Gray">
          <StackPanel>
            <StackPanel.Resources />
            <Label Margin="5,5,5,0"
                   BorderThickness="1"
                   FontSize="16"
                   Style="{StaticResource DefaultLabelStyle}">
              <Label.Content>
                <Binding Path="CurrentUser.Name"
                         StringFormat="{}Оператор: {0}" />
              </Label.Content>
            </Label>
            <Button Margin="5,3,5,5"
                    Command="{Binding ChooseUserCommand}"
                    Content="Сменить пользователя"
                    FontSize="16"
                    Style="{DynamicResource ButtonMainStyle}" />
          </StackPanel>
        </Border>
      </Grid>
      <!--  Century / Tempus Sans ITC / Kristen ITC / Broadway / Jokerman  -->
      <!--  Segoe UI / Arial Unicode MS / Book Antiqua / Century Gothic  -->
      <Label Grid.Row="3"
             Content="{Binding CurrentDateTime}"
             DataContext="{Binding Source={StaticResource Locator},
                                   Path=Main}"
             FontFamily="PT Mono"
             FontSize="18"
             FontWeight="Medium"
             Style="{StaticResource DefaultLabelStyle}"
             TextOptions.TextFormattingMode="Ideal" />
    </Grid>
 
  </Grid>
</Window>
0
995 / 893 / 354
Регистрация: 24.03.2014
Сообщений: 2,381
Записей в блоге: 2
26.05.2014, 15:27 7
Casper-SC, пока не получается со шрифтами на ошибку выйти... А в другом проекте не пробовали проверять? И, кстати, шрифт в системе установлен или откуда-то из ресурсов тянется?
0
Эксперт .NET
4432 / 2092 / 404
Регистрация: 27.03.2010
Сообщений: 5,657
Записей в блоге: 1
26.05.2014, 15:28  [ТС] 8
Цитата Сообщение от Spawn Посмотреть сообщение
И, кстати, шрифт в системе установлен или откуда-то из ресурсов тянется?
В системе. на другом проекте не пробовал.
0
26.05.2014, 15:28
IT_Exp
Эксперт
87844 / 49110 / 22898
Регистрация: 17.06.2006
Сообщений: 92,604
26.05.2014, 15:28
Помогаю со студенческими работами здесь

DependencyProperty + Binding в WPF
Здравствуйте. Решил попробовать поработать со свойствами зависимостей и наткнулся на ткую штуку...

DependencyProperty и TwoWay биндинг
Здравствуйте! Я хочу сделать двустороннюю привязку текста в окне View к строковой переменной в...

Пример реализации DependencyProperty, INotifyPropertyChanged
В общем суть проблемы такая. Решил запилить програмку в WPF но DepencyProperty и INotifify уж...

Не работает Binding для DependencyProperty
Вот тут не работает привязка: &lt;da:MyShort Value=&quot;{Binding Path=subId}&quot; /&gt; public class...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
8
Ответ Создать тему
Опции темы

КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2024, CyberForum.ru