小编Nie*_*lny的帖子

如何在UWP中删除ListViewItem的破碎背景?

在此输入图像描述

我用一些项目创建了Listview.当我点击一个时,我正在导航到新页面.当我按下时,我将回到旧页面(主菜单页面 - >项目页面 - >通过Frame.GoBack()支持主菜单),我看到所有最后点击的项目都是灰色背景.我试图将背景设置为透明,但它不起作用.

在桌面上此问题不存在,背景为黑色. 我正在Windows 10 RS2和Windows 10 Mobile上测试它最后一个内部构建在L640XL.

列表显示:

<ListView Grid.Row="
          Name="LineSecondTrackListView"
          ItemsSource="{x:Bind _LineSecondTrackBusStops}"
          ContainerContentChanging="SetBusStopViewAttribute"
          ItemTemplate="{StaticResource BusStopListViewStyle}"
          SelectionMode="Single"
          SelectionChanged="LineTrackListView_SelectionChangedAsync">
              <ListView.ItemsPanel>
                  <ItemsPanelTemplate>
                      <ItemsWrapGrid HorizontalAlignment="Center"
                                     Orientation="Horizontal" 
                                     MaximumRowsOrColumns="1"/>
                  </ItemsPanelTemplate>
              </ListView.ItemsPanel>
</ListView>
Run Code Online (Sandbox Code Playgroud)

我是如何支持的:

public static void BackButtonPressed(object sender, BackRequestedEventArgs e)
{
    Frame mainAppFrame = MainFrameHelper.GetMainFrame();
    Type currentPageType = mainAppFrame.CurrentSourcePageType;
    bool goBack = IsGoBackFromPageAllowed(currentPageType);
    if (goBack)
    {
        mainAppFrame.GoBack();
        e.Handled = true;
        return;
    }
    App.Current.Exit();
}

private static bool IsGoBackFromPageAllowed(Type currentPageType)
{
    if (currentPageType == typeof(Pages.Lines.LinesViewPage))
        return true;
    if (currentPageType == typeof(Pages.Lines.LinePage))
        return …
Run Code Online (Sandbox Code Playgroud)

c# listview uwp

6
推荐指数
1
解决办法
237
查看次数

如何比较厚度?

我想thickness通过检查 ThicknessA是否等于thicknessB 进行比较,

并且......它不起作用.总是假的,为什么?

PS.

为什么new Thickness(2.1) returns 2.09923289[..]不2.1 和new Thickness(2.0)回报清楚2.0?

厚度

c# uwp

2
推荐指数
1
解决办法
155
查看次数

标签 统计

c# ×2

uwp ×2

listview ×1