Metro XAML - Where Is LayoutTransform ? - xaml

Im authoring some Windows 8 Metro template (custom) controls and there doesnt seem to me any LayoutTransform properties on anything.
this is a real pain, as I want to rotate some text 90 desgrees, but the grid is sizing to the size of the text before the rotation.
Does anyone have an idea on how to fix this without writing lots of hacks ?
Dean

I modified the Silverlight toolkit version and published it here
Layout transform in Windows 8 XAML

LayoutTransform was gone in Silverlight too. (IMHO) I guess maybe it was usually overused or abused in WPF causing performance issues, so for better perception of the framework - it was never added to Silverlight and by extension - to WinRT.
There seems to be a workaround for that in the Silverlight Toolkit that should be easy to port - check the LayoutTransformer control. I have never used it, but it sounds like what you need.
*Edit 2017-04-24
There's a LayoutTransformControl in WinRT XAML Toolkit you could use.

Related

Is it possible to use platform native (Windows) XAML in Maui?

This is a bit of a continuation to How could one to merge resource dictionaries either dynamically or in compile time? (or to .NET MAUI: can we also have platform-specific XAML?).
I was reading https://learn.microsoft.com/en-us/windows/apps/design/style/xaml-theme-resources#the-xaml-type-ramp to see about Fluent design guidelines. Then I thought about applying them to Maui. Using "the technique of merge dictionaries" I thought that maybe it's possible to take Windows native XAML from https://github.com/microsoft/microsoft-ui-xaml/blob/cb181acede22577c59c5dc250361d3340252f4e9/dev/CommonStyles/TextBlock_themeresources.xaml#L21 and put that to Windows only XAML.
But of course that does not work like that, since eventually the Maui XAML compiler and Maui application load the XAML and they do not recognize that. Even if it would involve only Windows platform.
But I wonder if someone knows to tell if it is possible (or not) use Windows native XAML like that?
I suspect the answer is similar to Can I use existing WinUI3 controls in MAUI project?, but I'll ask explicitly in any case.
No; that wouldn't make sense:
WIndows XAML represents WinUI 3 controls (part of Windows App SDK), and their properties. Many properties are specific to Windows.
Maui XAML has its own cross-platform controls. These are designed to be easily mapped to native controls on different platforms.
This is sort-of-like asking if iOS APIs can be used on Android. Not compatible.
Though the differences are not as extreme as between iOS and Android; see next section.
OTOH, there are strong similarities in some features between all XAMLs (WPF, Xamarin.Forms/Maui, Windows): XAML Standard; XAML dialect alignment.
That doc explains the situation; Microsoft did not succeed in making a "common subset" that all XAMLs would support.
But they did identify differences, and have made a few additions here and there to increase similarity.

Alternative to Scrollviewer in Telerik Silverlight

Our company is currently using both the Telerik Silverlight tools and the Silverlight Toolkit to accomplish what we need in our program. Since Silverlight is dying out and the Silverlight Toolkit has not been updated since 2011, we are removing all dependencies on the Silverlight Toolkit and trying to replace those controls with a Telerik Alternative so that we are not using both toolkits. This way our customers only needs to download a 5mb file rather than a 10mb fileI've gone through and removed just about every dependency except two, one of which is the ScrollViewer. We use the Scrollviewer several times to create a scrollable area within another grid etc. I've looked around and found that Telerik doesn't have a direct alternative to the ScrollViewer but they do have some scrolling functionality within their RadGridView. That won't exactly work for us, and either way it will be slow because is we put a RadGridView where the ScrollViewer is, we would be placing it in controls that have auto sizing or measure with infinity. According to Telerik's site: Try not to place RadGridView in controls/panels which will measure it with infinity. Either way that seems like it would be very cluttered in our case.I was wondering if there was some ScrollViewer alternative in Telerik that I'd be able to use. If worst comes to worst, does making our own custom ScrollViewer seem reasonable?Any help is appreciated. Thanks!
EDIT: More specifically, the ScrollIntoView() function in the ScrollViewerExtensions from the Silverlight 5 Toolkit needs replacing. If there is no other control that has the built in functionality to scroll to an object within the control, then I can probably just create the method myself.
I'm not sure if Telerik has similar ScrollViewer extensions, but one solution would be to copy-paste the relevant code from the Silverlight Toolkit source -- the ScrollViewerExtensions class.

Mono Control Drawing?

I was wondering how Mono draws its controls ? I'm thinking of using it for a cross platform program but I can't find any comparisons of what it looks like on each platform (the lack of media on their official website is also concerning). I may also want to create my own controls with my own drawing functions so I was wondering if it does something like Qt in that it handles all it's own drawing so it looks the same across platforms.
All Mono Winforms control drawing is done by Mono in C# using System.Drawing. Controls look like Win32 classic on all platforms.
Some screenshots are available on the screenshots page:
http://mono-project.com/Screenshots
Note you'll want to scroll down for Winforms.

Tips on debugging UI errors in Windows Phone 7

I have a Windows Phone 7 application and I regularly see "weird" UI glitches that take me AGES to debug. It's a range of issues like controls appearing to have extra margin, scrollbars not appearing, animations looking really glitchy, entire page scrolled down, combobox items offset, etc. etc.
I'm happy to admit it might be me - but how to you debug UI errors like this? I know there's Silverlight Spy for the PC Silverlight Apps. Is there anything like this for Windows Phone 7?
Any debugging tips v much appreciated.
I have found that it is a good idea to start with Windows Phone 7 Design Templates, adopt a version control system right from day one of the project and to edit the XAML, use Expression Blend. The Visual Studio is great for writing code, but, to harness the real power of the tools, Expression Blend is the best to style your application.
HTH,
indyfromoz
Here are some tips:
Many people have issues with the emulator due to their graphics card.
Things like slow animations and ui glitches are very common.
Check that your graphics card is Direct X 10.1 at least and that your Driver
Model is WDDM 1.1
Make sure you have the latest drivers.
Windows 7 has less issues with the emulator than Vista
Make sure you have the latest tools, get the RTM release from the website.
In the RTM release, the frame rate counters are displayed by default in a vertical bar on the left, you should monitor these to check for performance issues
Here are a couple of things which I normally do... none of them are real smart, but sharing nevertheless.
Deploy it after every 2-3 controls that you add and ensure things are correctly laying out.
If by chance it doesn't work the way I am expecting it to, I have a parallel Silverlight 3 project running in which I typically paste the XAML and see if it works fine.
After that, I typically check it out as a Silverlight project since even I am not sure of any tools available for Win Phone 7.
I have favorited this question and I hope someone points us to something more interesting.
There's a lot you can checkout with Blend as Indy suggests. This is really good advice.
Regarding some of your specific issues these aren't necessarily glitches. I'll comment on a couple that stand out.
Extra margin - this and padding are built into the metro controls by design. Again, in blend you can dig into this by retemplating the control and changing properties of objects within the control.
The procedure for this is rclick the control, edit template, edit a copy. Then you can look at the different states and objects and change things as suits. While doing this please keep in mind the App Certification Requirements and UI Design Guidelines.
Regarding scrollbars, these are by design hidden until you start scrolling. You can control their availability with Horizontal/VerticalScrollBarVisibility on relevant controls (or on the ScrollViewer embedded in some controls - again retemplate in blend).
Combobox isn't metro themed so is going to struggle in the fitting in department, but there are posts around where people have done work on this. ListPicker is a better fit imo from the Windows Phone Toolkit released with the RTM tools.
If you can't see any obvious causes for the glitches in your code the first thing I would recommend is to actually test your app on a real device. Somethings - particularly animated objects -don't always look exactly the same when you run them on a device.
I thought I had a animation glitch in one of my apps but it only appears in the emulator. When I run on an actual device I don't see it.
Of course this doesn't help you if you can't get a phone to test it on yet, but before you potentially waste hours trying to debug a problem you might not have I would work on the rest of the app until such time as you can test the app on a real phone.
The same goes for anyone creating animations - don't waste time perfecting animations in the emulator. The timings will almost certainly be different on the actual device, so wait till you have one to test on.

setting form to look like this image?

is it advisable to play with the controls to make my form look like this or should i just use this graphic and place it in the background. if the former, then please suggest which controls on the form i can tweak to make the form look like this?
alt text http://img10.imageshack.us/img10/2351/huesaturation.jpg
To create something like this, I would suggest moving from winforms to Windows Presentation Foundation (WPF) if you have the option. There is much better support for creating these type of rich interfaces in WPF, although it does mean introducing a .NET 3.0+ requirement to your application.
To get you started, here are some tutorials:
http://dotnetslackers.com/articles/silverlight/WPFTutorial.aspx
http://msdn.microsoft.com/en-us/library/ms752299.aspx