On this page in Windows Dev Center it says
The new dynamic overflow behavior will automatically move primary commands into the SecondaryCommands area when space is limited.
But in my App there are only 4 Buttons Visible, the 5th one is not there, also not if I open the Menu, I have to put it manually into the SecondaryCommands List, to make Windows showing it.
I made a plain simple CommandBar to test it
<CommandBar>
<AppBarButton Icon="Find" Label="test" />
<AppBarButton Icon="Find" Label="test" />
<AppBarButton Icon="Find" Label="test" />
<AppBarButton Icon="Find" Label="test" />
<AppBarButton Icon="Find" Label="test" />
</CommandBar>
Build Target and Min Version is 10.0 10586.
Also I noticed that CommandBarOverflowButtonVisibility and similar properties can't be found.
This is a feature that won't appear until the Anniversary Update--the documentation has just been updated too early. You can see the feature get explained in detail in this video from //BUILD 2016 at about 11:35. It is not currently available in Build 10586.
Related
Problem:
After updating a few WPF projects in C# using Visual Studio to a higher target framework such as .NET 4.7, I noticed that wherever I used a Border.Clip in my xaml code, it would "mask" and hide everything in the design preview. All compiles and runs just fine but when working on the code in XAML, it is hard to see any visual feedback with code changes since the clip "masks" everything when before in older .NET frameworks, I never had this issue. Can someone explain why this is happening and what a solution may be?
Here is an example of what I see in a xaml file when I add a Border.Clip (Again, a complied version will show the real elements, it only appears this way in the preview in Visual Studio)
Border.Clip
`
<Border.Clip>
<RectangleGeometry RadiusX="10" RadiusY="10">
<RectangleGeometry.Rect>
...Some binding for dimensions.
</RectangleGeometry.Rect>
</RectangleGeometry>
</Border.Clip>
`
Omitting this code, will reveal all UI elements in the preview.
Again, the code is correct and does its job on runtime. With that said, I've tried both omitting and being super specific about any radius, shape, or dimensions of the clip and both still "mask" the preview.
For example just adding this line of code, masks everything.
`
<Border.Clip>
</Border.Clip>
`
As you could see I didn't have your problem.
My test environment is in VS 2022 Community 17.4.1 .Net Framework 4.8.
Maybe there is a little problem with your usage, please refer to the following documents.
My demo code:
<Grid>
<Canvas>
<Image Source="Your path" Height="150" Canvas.Left="148" Canvas.Top="67">
<Image.Clip>
<RectangleGeometry Rect="100 75 50 50"/>
</Image.Clip>
</Image>
<Border Background="Chocolate" BorderBrush="Black" BorderThickness="3" Width="300" Height="250" Canvas.Left="387" Canvas.Top="67">
<Border.Clip>
<RectangleGeometry Rect="100 75 50 50"/>
</Border.Clip>
</Border>
</Canvas>
</Grid>
So, Windows build 1903 sdk has applied a default "Shadow" on certain xaml controls, as can be seen from the list. I am using CommandBar in a project, and the "See more" button has an associated Popup with it, however I find no way to disable the shadow of it. This shadow does not show in any other previous windows Builds. Reference: https://learn.microsoft.com/en-us/windows/uwp/design/layout/depth-shadow
In the microsoft's blog post regarding this, they have given out the following code to remove shadow from a flyout like object, however they did not specify any code for removing the shadow from other controls.
This particular property in the following code named "IsDefaultShadowEnabled" is only accessible from the FlyoutPresenterStyles, I have tried from other controls, such as GridView, Border, couldn't find it in there. I tried attaching this flyout with the flyoutbase associated with the command bar. but did not help.
I added the code for the commandbar I am having the shadow on.
<Flyout>
<Flyout.FlyoutPresenterStyle>
<Style TargetType="FlyoutPresenter">
<Setter Property="IsDefaultShadowEnabled" Value="False" />
</Style>
</Flyout.FlyoutPresenterStyle>
</Flyout>
<CommandBar Background="Yellow" FocusVisualPrimaryThickness="0" FocusVisualSecondaryThickness="0">
<CommandBar.CommandBarOverflowPresenterStyle>
<Style TargetType="CommandBarOverflowPresenter">
<Setter Property="BorderThickness" Value="0"/>
</Style>
</CommandBar.CommandBarOverflowPresenterStyle>
<CommandBar.SecondaryCommands>
<AppBarButton Label="YELLOW!"/>
<AppBarButton Label="YELLOW!"/>
<AppBarButton Label="YELLOW!"/>
</CommandBar.SecondaryCommands>
</CommandBar>
Can you guys tell me any workaround to fix the shadow issue if there's no direct solution?
With # Faywang - MSFT 's advice, the issue was registered in Win UI team's repository,
Mr. #jevansaks response mentioned of using SDK Build Version 1903 as the Target version, additionally setting the MaxTestedVersion to the version one tested their app on.
https://github.com/microsoft/microsoft-ui-xaml/issues/1136
In conclusion, to fix Shadows, we need to set Target Version for building app to SDK 1903, however we can set MaxTestedVersion to the version we tested our app on, for instance it can be 1809.
I want to bind an AppBarButtons into a CommandBar.
I tried looking through the CommandBar documentation and found out that part is PrimaryCommands but I try to bind it but it read-only and I can't write anything to it.
Here is what I wanted to do.
<CommandBar PrimaryCommands={x:Bind AdditionCommands}/>
So, later on, I could just:
<customUI:PauseMenu>
<customUI:PauseMenu.AdditionCommands>
<AppBarButton Label="Some"/>
<AppBarButton Label="Commands"/>
<AppBarButton Label="Heres"/>
</customUI:PauseMenu.AdditionCommands>
</customUI:PauseMenu>
Can I bind AppBarButtons into CommandBar.PrimaryCommands
CommandBar does not support bind PrimaryCommands like the above. The only implementation way of PrimaryCommands is create list AppBarButton under that node. Please refer this document.
<CommandBar.PrimaryCommands>
<AppBarButton Label="Some"/>
<AppBarButton Label="Commands"/>
<AppBarButton Label="Heres"/>
</CommandBar.PrimaryCommands>
I've written an app with using SciSchart surface with some modifiers.
<s:SciChartSurface x:Name="scichartSurface" Grid.Row="1" Grid.Column="1" MouseLeftButtonDown="scichartSurface_MouseLeftButtonDown"
PreviewMouseLeftButtonDown="scichartSurface_MouseLeftButtonDown" MouseDoubleClick="scichartSurface_MouseDoubleClick">
<s:SciChartSurface.XAxis>
<s:DateTimeAxis x:Name="X1" Id ="XAxis" AxisTitle="Время" SubDayTextFormatting="dd.MM.yyyy HH:mm:ss" />
</s:SciChartSurface.XAxis>
<s:SciChartSurface.YAxes>
<s:NumericAxis x:Name="Default" Id="Value" AxisTitle="Значение" AxisAlignment="Left" VisibleRange="-10, 110" Visibility="Collapsed" ToolTip="Ось безразмерных величин"/>
</s:SciChartSurface.YAxes>
<s:SciChartSurface.ChartModifier >
<s:ModifierGroup x:Name="mGroup">
<s:RubberBandXyZoomModifier x:Name="rubXyModifier" ExecuteOn="MouseLeftButton" IsXAxisOnly="{Binding Path=(local:SessionVariables.IsXScaleOnly), UpdateSourceTrigger=PropertyChanged}"
RubberBandFill="#33FFFFFF" RubberBandStroke="DarkRed" ZoomExtentsY="{Binding Path=(local:SessionVariables.IsYScaleOnly), UpdateSourceTrigger=PropertyChanged}"
RubberBandStrokeDashArray="2 2" IsEnabled="{Binding Path=(local:SessionVariables.IsScaleMode), UpdateSourceTrigger=PropertyChanged}"/>
<!-- Allow pan on Right mouse drag -->
<s:ZoomPanModifier x:Name="zoomPanModifier" ExecuteOn="MouseLeftButton" ClipModeX="None" IsEnabled="{Binding Path=(local:SessionVariables.IsMovingMode), UpdateSourceTrigger=PropertyChanged}"/>
<!-- Allow Dragging YAxis to Scale -->
<s:YAxisDragModifier x:Name="yDrag" DragMode="Pan" IsEnabled="{Binding Path=(local:SessionVariables.IsMovingMode), UpdateSourceTrigger=PropertyChanged}"/>
<!-- Allow Dragging XAxis to Pan -->
<s:XAxisDragModifier x:Name="xDrag" DragMode="Pan" IsEnabled="{Binding Path=(local:SessionVariables.IsMovingMode), UpdateSourceTrigger=PropertyChanged}"/>
<!-- Allow Mousewheel Zoom -->
<!--<s:MouseWheelZoomModifier IsEnabled="{Binding Path=(local:SessionVariables.IsMovingMode),Converter={local:BackBoolConverter}, UpdateSourceTrigger=PropertyChanged}"/>-->
<s:RolloverModifier ExecuteOn="MouseMove" ShowTooltipOn="Never" SourceMode="SelectedSeries" x:Name="rollModifier"/>
<!--Реперы-->
<s:VerticalSliceModifier x:Name="sliceModifier"/>
<!--Курсор с перекрестьем-->
<s:CursorModifier IsEnabled="True" ShowTooltip="True" ShowTooltipOn="Never"
ShowAxisLabels="True" SourceMode="AllVisibleSeries" x:Name="cursModifier"/>
<s:TooltipModifier >
</s:TooltipModifier>
</s:ModifierGroup>
</s:SciChartSurface.ChartModifier>
</s:SciChartSurface>
While using this surface I get an error, occurs randomly. The error is
The specified Visual element is already a child of another Visual
element or the root CompositionTarget element
Also, I've got a StackTrace for this error.
After analyzing it I decided that the problem is in VerticalSliceModifierBase.AttachRolloverMarker() method, but I've no idea about the reason. Can you help me?
First thing I'd suggest is update.
The latest version is SciChart v5.3.0 which is available from NuGet.
Since version 4.2.5 SciChart has fixed hundreds of bugs since v4.2.5 released 18 months ago (see release history) and update frequency is very high. If the latest version has the problem, post a code sample on the SciChart forums and it will be investigated
I am trying to use NavigationView with custom icons as Menu Items in my UWP app. However, it seems NavigationView don't accept custom icons or BitmapIcon. The sample application I have seen in android is below;
Sample Code of NavigationView Menu Items
<NavigationView.MenuItems>
<NavigationViewItem Name="SalahNavItem" Icon="CustomIcon" Content="Apps" Tag="Salah"/>
<NavigationViewItem Name="AppsNavItem" Icon="CustomIcon1" Content="Apps" Tag="apps"/>
</NavigationView.MenuItems>
What I am trying to achieve is to add custom Icon / Image in Menu Items, any clue about it in UWP?
You can add custom Icon Use
<NavigationView.MenuItems>
<NavigationViewItem Name="SalahNavItem" Icon="CustomIcon" Content="Apps" Tag="Salah">
<NavigationViewItem.Icon>
<!-- Use Custom icon <FontIcon Glyph=""/>
Or <BitmapIco UriSource="Path"/> -->
</NavigationViewItem.Icon>
<NavigationViewItem Name="AppsNavItem" Icon="CustomIcon1" Content="Apps" Tag="apps"/>
</NavigationView.MenuItems>
See this link
Expanding a bit on the above answer:
<BitmapIcon UriSource="ms-appx:///Assets/globe.png"/>
https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.bitmapicon?view=winrt-22000