kandi X-RAY | soft-ui Summary
kandi X-RAY | soft-ui Summary
soft-ui
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of soft-ui
soft-ui Key Features
soft-ui Examples and Code Snippets
Community Discussions
Trending Discussions on soft-ui
QUESTION
I have created the custom controls. I have did the code changes to fix the issue in the AppWindow by setting the XamlRoot. But what's my problem is XamlRoot is available only in latest version.
So I changed the source target version to the latest version. When I create the UWP app with the same version of custom control, it works fine. But when the UWP project version has a lower target version (which doesn't support XamlRoot), I have got an exception:
Method Not Found
I have checked the conditions to execute the XamlRoot code only when targetversion is higher. But it does not work. I have tried with ApiInformation
, but it is also of no use, since this is only to make the UWP app compatible for every device and not depends on the App TargetVersion.
Please refer the below code which I uses to fix the issue in the popUp
...ANSWER
Answered 2021-Apr-14 at 03:03Based on the XamlRoot class, it requires Windows 10, version 1903 or higher. You could not find this object in the lower version of UWP. You have to set the min version as 1903 to avoid compile issue.
QUESTION
In the ctor of the code-behind we have the code below copied from microsoft-ui-xaml-specs
...ANSWER
Answered 2020-Nov-20 at 21:50If you have registered for the WebMessageReceived event but aren't seeing your event handler run you might check the following:
- Ensure you register for the WebMessageReceived event before the webpage you load executes the
chrome.webview.postMessage
. If you register the event handler after the page posts the message, the event handler won't fire. Similarly, you must watch out for races. For instance, if you navigate to a page that executes postMessage while the page is loading and then register the WebMessageReceived event there's no guarantee which will finish first and you may or may not receive the message. - Ensure the code in your page is actually running
chrome.webview.postMessage
and successfully. You can use the DevTools in the WebView2 to put a breakpoint on that line of code in your page and validate that it executes and that you don't throw an exception before running that code.
QUESTION
I have this code:
...ANSWER
Answered 2020-Nov-12 at 16:26As noted on the Grid Docs page the default value for Width
(or Height
in the case of RowDefinitions
) is *
.
The default value of the RowDefinition.Height property is *. Similarly, the default value of the ColumnDefinition.Width property is *. Therefore, it's not necessary to set these properties in cases where these defaults are acceptable.
(from the first "Important" box on the page at the time of writing)
That means, whenever you don't specify the property explicitly, the value is *
. So when you want to use the short-hand notation you would need to use *
QUESTION
I created a new UWP project with a NavigationView
(winui 2.4) in MainPage.xaml.
I proceeded by binding a hierarchical ObservableCollection
to populate the NavigationView
menu items (1 parent, 4 children)
Launching the application, the hierarchical structure renders as expected, and seem to be working fine.
My next objective would be to collapse every expanded menu item clicking on a button. To do so, the docs suggest using NavigationView.Collapse(NavigationViewItem)
: my intention would be to iterate through NavigationView.MenuItems
and collapse them.
The issue is that it seems NavigationView.MenuItems
returns empty and I cannot figure out why.
I included a Button that prints NavigationView.MenuItems.Count()
, which returns 0.
On the other hand, hard-coding the hierarchical menu items and repeating said procedure seem to work fine.
MainPage.xaml
...ANSWER
Answered 2020-Nov-13 at 02:20UWP: NavigationView.MenuItems results empty if populated programmatically
I can reproduce your problem that MenuItems.Count is zero. As your provide link said, you could also get the items with MenuItemsSource
property.
The parameter of Collapse
method is NavigationViewItem
, and we could not pass MenuItems element (data source type) into it directly. We need use the data source to find the matched NavigationViewItem
, the ContainerFromMenuItem
method is right choice for getting NavigationViewItem with data source. And then MenuItems
is not necessary for this scenario. Because categories
has been decaled previously. we could use it directly. So the code could be written like below.
QUESTION
I have come across a layout / template problem with CommandBar
of which symptoms are seen in several pages:
- UWP - CommandBar blank space under Buttons
- https://github.com/microsoft/microsoft-ui-xaml/issues/1024
It seems that the UWP CommandBar
elements inside the CommandBar
have an actual height of 44px, which is cropped in a control of 40px.
- When
IsOpen="False"
, theAppBarButton
s are vertically centered and the bottom 4px of theCommandBar.Content
section is not shown - When
IsOpen="Top"
, theAppBarButton
s are shifted up, an ugly gap appears under them and the bottom 4px of theCommandBar.Content
section is suddenly shown
Besides the ugly gap, it makes it very difficult to correctly vertically center elements in CommandBar.Content
.
About the vertical position of the CommandBar
- When the CommandBar is at the top of the Page, the CommandBar itself does not vertically resize.
- When the CommandBar is at the bottom of the Page, the CommandBar itself grows vertically with 4px.
- In all cases, the other symptoms happen
The red line visualizes the bottom 4px of the CommandBar.Content
section. Also, with the Reveal
effect to the left of the mouse cursor you can see that the buttons shift up. The whole CommandBar grows vertically
Is there any way to workaround this issue? Microsoft has qualified this more than a year ago as something they might fix in WinUI 3 which is far away.
Bug repro repository Relevant code to reproduce ...ANSWER
Answered 2020-Oct-26 at 02:58UWP CommandBar moves vertically when IsOpen changes
During the testing, AppBarSeparator
cause this behavior. Currently there is a work around that could fix this, please give AppBarSeparator
specific height less than 40px.
QUESTION
I have an issue with the NavigationView control in my UWP app. When I set the IsPaneToggleButtonVisible to false, my PaneHeader collapses too. Offically this bug was solved, am I doing something wrong?
...ANSWER
Answered 2020-Apr-06 at 05:15Based on this thread, it mentions
This issue was addressed in #1083, which has now been successfully released as Microsoft.UI.Xaml v2.2.190731001-prerelease.
This means the bug has solved in the Windows UI Library version of NavigationView, so if you want to show your PaneHeader, you need to install the Microsoft.UI.Xaml nuget package and then add to your Application.Resources.
.App.xaml:
QUESTION
I am trying to create a NavigationViewItem
which navigates to two different Views based on a condition.
The UWP app was created using Windows Template Studio and already has the NavigationView
and default functions to navigate between pages. I want to have the app check for a condition and then either navigate to one or the other View if the user clicks on the NavigationViewItem
. Also the app should keep the colored line, indicating which View it is on, on the one single NavigationViewItem
.
This is how my NavigationView
currently looks like. I would like to combine the SetTimer
and WatchTimer
Views. I unfortunately have no idea how the underlying code works as it was all automatically generated and I don't really understand it.
ANSWER
Answered 2020-Mar-17 at 07:36Based on the code you post, the navigation happens in the OnItemInvoked event. If you want to have conditions to control the process. That will be the right place. You could set different pagetype in NavigationService.Navigate(pageType)
according to different conditions.
Besides, I do not recommend you to use the code directly if you don't understand it. The codes contains all the functions but it also means you don't know why and how it works. It might be a better practice if you could try to implement the function by yourself using native code. After you know more about the navigation, then you could understand these code more easily.
QUESTION
Accessibility Insights for Windows shows the following property:
ControlType Group(50026)
when I hover over a search box that is an html tag.
I used Google Chrome Version 80.0.3987.87 (Official Build) (64-bit)
.
How does AI4W determine the control type of the html tag?
The accessibility insights doc says the control type is a concept from the Microsoft UI automation accessibility framework. You can look up the 50026
id for Group
on this reference page.
It is not yet clear to me how AI4W determined the exact control type. I suspect Chrome implements a Client-Side (Proxy) UI Automation Provider but I am not sure about it. If it does, how does the implementation deduce the control types?
Related questions:
...ANSWER
Answered 2020-Mar-03 at 17:08As described on this Chrome accessibility page, Chrome exposes HTML and ARIA control types/roles through an accessibility API called IAccessible2.
As of Windows 10.0.1903, Windows translates IAccessible2 into UIA. I was unable to find any documentation which specifically describes the mapping of IAccessible and IAccessible2 roles to UIA control types, but it is probably very close to the mapping recommended by the W3C.
Accessibility Insights displays the UIA control type after Windows has converted the IAccessible2 data to UIA.
QUESTION
Is there a way to hide the NavigationView pane in an UWP app but still showing the Frame control inside of it?
A little background info: I'm trying to implement a UI mode where the user is locked to some specific screens only. The user should be able to navigate in a "guided" way but not be able to navigate freely. Disabling or hiding of the NavigationItems is not enough as it could be confusing. It should be totally clear to the user that, if he wants to navigate freely again, he has to leave this locked state of the app.
I'm using the NavigationView from the WinUI library.
Here is a simplified snippet of my NavigationView XAML code:
...ANSWER
Answered 2020-Feb-25 at 03:00There is a IsPaneVisible property you can determine whether the pane is shown. When you want to hide the pane, set IsPaneVisible as false.
QUESTION
I add Microsoft::UI::Xaml NuGet package to my C++/WinRT Blank App project will raised error.
Output message:
1>------ Rebuild All started: Project: TxtRecordGenerator, Configuration: Debug x64 ------ 1>64 bit MIDLRT Processing C:\Users\a124p\Documents\GitHub\VisualizationRecorder\TxtRecordGenerator\App.idl 1>App.idl 1>64 bit MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\winrt\winrtbase.idl 1>winrtbase.idl 1>64 bit MIDLRT Processing C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\winrt\midlbase.idl 1>midlbase.idl 1>Processing WinMD 1>Processing input metadata file x64\Debug\Unmerged\App.winmd. 1>Processing input metadata file x64\Debug\Unmerged\MainPage.winmd. 1>Processing input metadata file x64\Debug\Unmerged\XamlMetaDataProvider.winmd. 1>Saved output metadata file TxtRecordGenerator.winmd. 1>Validating metadata file x64\Debug\Merged\TxtRecordGenerator.winmd. 1>pch.cpp 1>App.cpp 1>MainPage.cpp 1>module.g.cpp 1>XamlTypeInfo.Impl.g.cpp 1>XamlTypeInfo.g.cpp 1>C:\Users\a124p\Documents\GitHub\VisualizationRecorder\TxtRecordGenerator\Generated Files\XamlTypeInfo.g.cpp(919,77): error C2039: 'XamlTypeInfo': is not a member of 'winrt::Microsoft::UI::Xaml' 1>C:\Users\a124p\Documents\GitHub\VisualizationRecorder\TxtRecordGenerator\Generated Files\winrt\Microsoft.UI.Xaml.Controls.h(16562): message : see declaration of 'winrt::Microsoft::UI::Xaml' 1>C:\Users\a124p\Documents\GitHub\VisualizationRecorder\TxtRecordGenerator\Generated Files\XamlTypeInfo.g.cpp(919,65): error C3083: 'XamlTypeInfo': the symbol to the left of a '::' must be a type 1>C:\Users\a124p\Documents\GitHub\VisualizationRecorder\TxtRecordGenerator\Generated Files\XamlTypeInfo.g.cpp(919,79): error C2039: 'XamlControlsXamlMetaDataProvider': is not a member of 'winrt::Microsoft::UI::Xaml' 1>C:\Users\a124p\Documents\GitHub\VisualizationRecorder\TxtRecordGenerator\Generated Files\winrt\Microsoft.UI.Xaml.Controls.h(16562): message : see declaration of 'winrt::Microsoft::UI::Xaml' 1>C:\Users\a124p\Documents\GitHub\VisualizationRecorder\TxtRecordGenerator\Generated Files\XamlTypeInfo.g.cpp(919,111): error C3861: 'XamlControlsXamlMetaDataProvider': identifier not found 1>Done building project "TxtRecordGenerator.vcxproj" -- FAILED. ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
This seems to be the error WinRT C++ code generator caused.
The C++/WinRT project code file as follows:
pch.h code:
...ANSWER
Answered 2020-Feb-14 at 02:26First, you need to declare WinUI application resources in App.xaml:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install soft-ui
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page