How can I trace what happens during XAML loading in WinUI 3? - xaml

I have the same question Joe did, but for WinUI 3 desktop projects. Essentially, is there a way to trace what's happening and when, as XAML loads?
The solution for WPF appears to be a pre-defined set of TraceSources that simply need to be "turned on."
PresentationTraceSources.Refresh();
PresentationTraceSources.MarkupSource.Switch.Level = SourceLevels.All;
Is there anything similar for WinUI 3? I've tried enumerating TraceSources (similar to this article) but this only sees instantiated sources. I'd like to see if there are any sources embedded in SDK 1.1.2.

Related

Xamarin.Forms embed native controls for WPF

Following Native Views in XAML I see that it is possible to embed native views in XAML by specifying a value for targetPlatform in an appropriate xmlns attribute value.
In my sample project I have confirmed this works for UWP by using targetPlatform=Windows. This actually works fine.
However I wish to do the same thing for a WPF control and was wondering which targetPlatform value to use. I see from the article that targetPlatform should be set to one of values of the TargetPlatform enumeration. Looking at the documentation for TargetPlatform enumeration I see that it is obsolete and does not have a value for WPF. (I tried to use Other but this does not work.)
I see that Device.RuntimePlatform may be used in code, but not sure if there is a way to use it with the xmlns attribute.
How do I conditionally embed WPF native views in XAML? If this is not possible, what's the best way to do this?
At the moment WPF support is in beta and it is not possible, as you can see it is on TODO list at the moment: https://github.com/mohachouch/forms-wpf-progress/blob/master/Status.md
You can port any view using the custom renderer, but adding and binding properties even for just one control is a huge work.

Avalonia UI Carousel Example

I'm rather new to Avalonia UI / XAML / .NET MVVM in general. While I really like Avalonia so far, it's still in beta and lacks extensive documentation. Hence I sometimes struggle to get specific things working or finding out how I should use them correctly.
Could somebody point me to an example using the Carousel control? Which properties should I set in the xaml, what kind of item list should be behind it etc?
Cheers.
You can find usage example in ControlCatalog project from the main repository:
https://github.com/AvaloniaUI/Avalonia/blob/master/samples/ControlCatalog/Pages/CarouselPage.xaml
https://github.com/AvaloniaUI/Avalonia/blob/master/samples/ControlCatalog/Pages/CarouselPage.xaml.cs

How can I create a menu in levelhelper?

I want to create game with Spritehelper and Levelhelper. I wanted to know, how to create the menu with levelhelper.
How can I achieve this?
Look through this tutorial(http://www.raywenderlich.com/4622/how-to-use-spritehelper-and-levelhelper-tutorial), they provide detailed information and have LevelHelper/SpriteHelper tutorials provided by the developer himself.
After some research of instruments for new game I came to this conclusion:
Level Helper 2:
good levels editing
SpriteHelper support
no UI editor (no UI controls)
own class stack inherited from standard cocos2d classes (no way to create other nodes, not inherited from LHxxxx)
animations editor
physics editor
CocosBuilder
is not supported by developers (last update 2 years ago)
is universal: you can create UI and levels in it
has some bugs, but is open source, so you can easily fix some issues
uses default cocos2d class stack. You can instantiate any class inherited from Node
supports relative node positioning (in percents relative to parent size)
built in support of sprite sheets
animations editor
SpriteBuilder
new editor, based on idea of CocosBuilder (very similar to it)
is under active development by cocos2d developers
is universal (UI and levels)
very good layout features
supports only cocos2d-swift :-(
there is some 3rd party cocos2d-x loaders of SpriteBuilder scenes, but they are not always compatible with new versions of SpriteBuilder
animations editor
physics editor
Cocos Studio 1.x, 2.1
troubles with loading scenes from v1 in cocos2d-x v3 and above
new version of CocoStudio (2.1 for now) is still not ready for production and doesn't support many features from v1
supports relative node positioning (in percents relative to parent size)
animations editor

"Loading Checklog" error while loading quartz composition using Quartz Composer Patch Controller

I've created a composition in Quartz Composer, and am following the examples on "Quartz Composer Programming Guide" on Apple's website for connecting it to a XIB.
My goal is to be able to bind inputs in my Quartz Composition with UI controls (sliders, keyboard input, etc.) within my Cocoa application. It seems that this tutorial is sufficient for what I want to do.
However, I can't get the Quartz Composer Patch Controller to load my composition. I add the Patch Controller to my XIB document window, then I go to "Load Composition".
Every time I click "Load Composition", I choose my file and it gives me an error message box that says "Loading Failed: Loading CheckLog".
Here's what may be interesting: I can view my composition if I load it with a QCView object, but can't load it in the Patch Controller.
I've tried loading other compositions, I get the same error. I tried in a different computer, on a new project, same XCode version (4.0.1), and I still get the error.
I've only done the steps outlined in the tutorial, and I am referencing the Quartz framework in my project. My first thought is that there might be some procedures that are not outlined in the programming guide that I may be skipping.
So how do I resolve this error? Please help!
I assume the “CheckLog” bit means that there’s something in the system log (open /Applications/Utilities/Console.app and look under Console Log). There might also be something in ~/Library/Logs/. (Shamefully bad UI in any case, of course.)
I had this problem - solved it by making sure that I was using the corresponding version of quartz composer and xcode since I have multiple versions of developer tools installed. (use both applications contained within the same developer folder).

How build a custom control in Xcode for the iPhone SDK?

I want to build a custom control to reuse in my project which consists of two UITextFields that are linked together + a label.
It is starting to become repetitive across my App and smells of code duplication ;)
However, I wonder what is the best aproach here.
Is it best do everything by code in a controller or is posible do a visual thing like the ones built-in in Xcode?
You can build an Interface Builder plug-in for this. It's fairly straight-forward. To get started, read the Interface Builder Plug-In Programming Guide. It even has a quick, step-by-step tutorial to get you started. Apple recommends creating a plug-in to IB for just your case...
I don't think this is possible. I briefly looked at the IB Plug-In Programming Guide and apparently Interface builder plugins are implemented through Custom Cocoa Frameworks. That is, your plugin is defined in a framework which is loaded in Interface Builder. IB looks in the current projects frameworks to find any custom components defined and will load plugins accordingly. It is not possible to use custom or third party frameworks on the iPhone so I don't see how IB would make a connection here. If somebody has more info I'd love to see this discussion continued.
This is fine except it is for the iPhone. The iPhone presents a more difficult environment to create the plug-in for interface builder. It should be possible but I have yet to see a Xcode project that does this. They are all limited to creation of desktop "AppKit" versions, not iPhone "UIKit" versions of the plugins for IB.