Multiple DrawingViews? #794
-
I would love to present a mockup of .NET Maui Apps to my CEO, but as I initalized many DrawingViews in xaml, the drawed lines are shared between those multiple drawingviews. I guess they use the same object for the drawed lines, but how can i use more than one drawingview? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 2 replies
-
Beta Was this translation helpful? Give feedback.
-
Yeah, I'm having this issue too. It seems there's one static storage for drawn lines. If I go to a new page, and put a drawingview there, it will show the drawing from a completely different page. As soon as you clear the lines, all drawing views in the app are cleared. As soon as you complete drawing a line, it's shown on all drawing views in the app. |
Beta Was this translation helpful? Give feedback.
-
Found it! That there's a default one-time created The workaround then is simple. Set the |
Beta Was this translation helpful? Give feedback.
-
The fix is to change the line I link above to: nameof(Lines), typeof(ObservableCollection<IDrawingLine>), typeof(DrawingView), defaultValueCreator: (_) => new ObservableCollection<IDrawingLine>(), defaultBindingMode: BindingMode.TwoWay); I'll make a PR after lunch. |
Beta Was this translation helpful? Give feedback.
-
@maslewandowski PR is merged. Could you mark this question as answered? |
Beta Was this translation helpful? Give feedback.
-
Closed as answered |
Beta Was this translation helpful? Give feedback.
The fix is to change the line I link above to:
I'll make a PR after lunch.