File tree Expand file tree Collapse file tree
WpfAnalyzers.Test/WPF0010DefaultValueMustMatchRegisteredTypeTests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -273,6 +273,40 @@ static BarControl()
273273 RoslynAssert . Diagnostics ( Analyzer , ExpectedDiagnostic , fooControlCode , code ) ;
274274 }
275275
276+ [ Test ]
277+ public static void FrozenGeometry ( )
278+ {
279+ var code = @"
280+ namespace N
281+ {
282+ using System.Windows;
283+ using System.Windows.Controls;
284+ using System.Windows.Media;
285+
286+ public class C : Control
287+ {
288+ public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
289+ nameof(Text),
290+ typeof(string),
291+ typeof(C),
292+ new PropertyMetadata(↓Default()));
293+
294+ public string? Text
295+ {
296+ get => (string?)this.GetValue(TextProperty);
297+ set => this.SetValue(TextProperty, value);
298+ }
299+
300+ private static Freezable Default()
301+ {
302+ var geometry = new EllipseGeometry(default, 5, 5);
303+ return geometry.GetAsFrozen();
304+ }
305+ }
306+ }" ;
307+ RoslynAssert . Diagnostics ( Analyzer , ExpectedDiagnostic , code ) ;
308+ }
309+
276310 [ Test ]
277311 public static void IntWhenTypeIsEnum ( )
278312 {
You can’t perform that action at this time.
0 commit comments