Click here to Skip to main content
15,867,885 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Converting a byte[] to a ImageSource means huge memory leak Pin
Starwer30-Jan-22 5:04
Starwer30-Jan-22 5:04 
GeneralRe: Converting a byte[] to a ImageSource means huge memory leak Pin
Gerry Schmitz30-Jan-22 5:23
mveGerry Schmitz30-Jan-22 5:23 
GeneralRe: Converting a byte[] to a ImageSource means huge memory leak Pin
Starwer30-Jan-22 7:45
Starwer30-Jan-22 7:45 
SuggestionRe: Converting a byte[] to a ImageSource means huge memory leak Pin
Richard Deeming30-Jan-22 21:52
mveRichard Deeming30-Jan-22 21:52 
Question(MahApp) not using style for control Pin
Super Lloyd19-Jan-22 23:07
Super Lloyd19-Jan-22 23:07 
AnswerRe: (MahApp) not using style for control Pin
Super Lloyd19-Jan-22 23:08
Super Lloyd19-Jan-22 23:08 
QuestionMarkupExtension, resource files and visual studio designer Pin
Super Lloyd16-Jan-22 6:40
Super Lloyd16-Jan-22 6:40 
QuestionTextBox Bound To Decimal - Can't Type Decimal Pin
Kevin Marois28-Dec-21 8:29
professionalKevin Marois28-Dec-21 8:29 
AnswerRe: TextBox Bound To Decimal - Can't Type Decimal Pin
Mycroft Holmes28-Dec-21 10:05
professionalMycroft Holmes28-Dec-21 10:05 
GeneralRe: TextBox Bound To Decimal - Can't Type Decimal Pin
Kevin Marois28-Dec-21 10:25
professionalKevin Marois28-Dec-21 10:25 
GeneralRe: TextBox Bound To Decimal - Can't Type Decimal Pin
Super Lloyd16-Jan-22 6:45
Super Lloyd16-Jan-22 6:45 
GeneralRe: TextBox Bound To Decimal - Can't Type Decimal Pin
Mycroft Holmes16-Jan-22 10:55
professionalMycroft Holmes16-Jan-22 10:55 
GeneralRe: TextBox Bound To Decimal - Can't Type Decimal Pin
Eddy Vluggen9-Feb-22 2:40
professionalEddy Vluggen9-Feb-22 2:40 
GeneralRe: TextBox Bound To Decimal - Can't Type Decimal Pin
Super Lloyd9-Feb-22 12:10
Super Lloyd9-Feb-22 12:10 
GeneralRe: TextBox Bound To Decimal - Can't Type Decimal Pin
Eddy Vluggen9-Feb-22 12:13
professionalEddy Vluggen9-Feb-22 12:13 
AnswerRe: TextBox Bound To Decimal - Can't Type Decimal Pin
Richard Deeming4-Jan-22 0:04
mveRichard Deeming4-Jan-22 0:04 
QuestionSetting DataGrid Cell Style From Code Behind Pin
Kevin Marois20-Dec-21 10:56
professionalKevin Marois20-Dec-21 10:56 
AnswerRe: Setting DataGrid Cell Style From Code Behind Pin
#realJSOP22-Dec-21 2:06
mve#realJSOP22-Dec-21 2:06 
QuestionInput Question Pin
Super Lloyd19-Dec-21 4:17
Super Lloyd19-Dec-21 4:17 
AnswerRe: Input Question Pin
#realJSOP19-Dec-21 22:26
mve#realJSOP19-Dec-21 22:26 
GeneralRe: Input Question Pin
Super Lloyd19-Dec-21 23:05
Super Lloyd19-Dec-21 23:05 
GeneralRe: Input Question Pin
#realJSOP19-Dec-21 23:18
mve#realJSOP19-Dec-21 23:18 
GeneralRe: Input Question Pin
Super Lloyd19-Dec-21 23:23
Super Lloyd19-Dec-21 23:23 
Question(Advanced?) Layout question Pin
Super Lloyd17-Dec-21 20:02
Super Lloyd17-Dec-21 20:02 
I have a FrameworkElement (subclass) in my app which is a host for custom Visuals (my app is a sort of drawing program).

Now I just put the first UIElement in the visual container. A UserControl which host a bunch of Controls, including a TextBox.

Now when the Text change and the text box resize and go outside the containing UserControl, it is clipped and does not show anymore.

I tried to set Clip to false on the UserControl, didn't help (in fact it was already false).

Now in my UIElement I can be aware of the need to resize, thanks to
C#
protected virtual void OnChildDesiredSizeChanged(UIElement child);

But I need to know that in my visual container.

At the moment it looks like it should only really be able to host & resize UIElement which implement some sort of INotifyResize interface, which I could inform thanks to this OnChildDesiredSizeChanged() method.

I wonder if there is already a way I can know that, with just any UIElement, not just the one made specifically to be hosted by that container.

EDIT / REMARK
5 minutes later... I think I might had answered my own question! OMG | :OMG: Roll eyes | :rolleyes: Big Grin | :-D
I could just override OnChildDesiredSizeChanged() in the visual container....
I think there might be some issues, because some ContainerVisual are involved in the Visual hierarchy... let's see...

EDIT2
So I tried that and it is really strange
C#
protected override void OnChildDesiredSizeChanged(UIElement child)
{
    base.OnChildDesiredSizeChanged(child);
    child.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
    child.Arrange(new Rect(BoundedVisual.GetLocation(child), child.DesiredSize));
}
This method is called only once and the child didn't resize...

EDIT3
Ha, I see, this didn't work, it this was another child (the one which display the scollbar). got nothing for the text...

EDIT / FOUND a solution
I am using this UIElement event to do my reArrange(), it seems to be working Smile | :)
C#
public event EventHandler LayoutUpdated;
A new .NET Serializer
All in one Menu-Ribbon Bar
Taking over the world since 1371!


modified 18-Dec-21 7:49am.

QuestionAbout RichTextBox size in a canvas Pin
Super Lloyd12-Dec-21 1:23
Super Lloyd12-Dec-21 1:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.