View Issue Details

IDProjectCategoryView StatusLast Update
0002014NoesisGUIC# SDKpublic2021-05-25 14:40
ReporterKeldorKatarnAssigned Tosfernandez 
Status assignedResolutionopen 
Product Version3.0.12 
Target VersionFixed in Version 
Summary0002014: WPF Inconsistency: PresentationSource missing
DescriptionThe class PresentationSource is missing
TagsNo tags attached.


child of 0001038 assignedsfernandez Caliburn.Micro metaticket 




2021-05-10 19:40

manager   ~0007239

What part do you need from PresentationSource?
The CompositionTarget, so you can register to the Rendering event?

In Noesis that event is part of the View that holds the UI tree. You can do:
someControl.View.Rendering += (s, e) => { // do something };


2021-05-10 20:19

reporter   ~0007241

Actually I'm doing this:
(I'm not 100% sure this even makes any difference in a game but... I'm using it in a decorator to compensate in case LayoutRounding is active. Maybe Noesis already compensates for that?)

        private Size GetDpi()
            return new Size(One, One);
            var source = PresentationSource.FromVisual(this);

            var dpiX = One;
            var dpiY = One;

            if (source?.CompositionTarget != null)
                dpiX = NinetySix * source.CompositionTarget.TransformToDevice.M11;
                dpiY = NinetySix * source.CompositionTarget.TransformToDevice.M22;

            return new Size(dpiX, dpiY);


2021-05-25 06:13

reporter   ~0007257

Actually, I just saw since Framework 4.6.2 this has been added
VisualTreeHelper.GetDpi(Visual visual)

Is that implemented in Noesis? If it is, I'm not going to need this I think

Issue History

Date Modified Username Field Change
2021-05-10 19:25 KeldorKatarn New Issue
2021-05-10 19:40 sfernandez Assigned To => sfernandez
2021-05-10 19:40 sfernandez Status new => feedback
2021-05-10 19:40 sfernandez Note Added: 0007239
2021-05-10 20:19 KeldorKatarn Note Added: 0007241
2021-05-10 20:19 KeldorKatarn Status feedback => assigned
2021-05-25 06:13 KeldorKatarn Note Added: 0007257
2021-05-25 14:40 KeldorKatarn Relationship added child of 0001038