小编Joh*_*rtz的帖子

UWP更改ListView项目高度

如何更改Windows 10 UWP应用程序中ListView控件中项目的高度?

例如,在UWP中,以下内容不会使行高度为20.(WPF问题可能表明这一点,但它似乎不适用于UWP XAML):

        <ListView x:Name="listView" IsItemClickEnabled="True">
            <ListView.ItemContainerStyle>
                <Style TargetType="ListViewItem">
                    <Setter Property="Height" Value="20" />
                </Style>
            </ListView.ItemContainerStyle>

            <ListView.ItemTemplate>
                <DataTemplate>
                    <StackPanel Height="20">
                        <TextBlock Text="{Binding Title}" TextWrapping="NoWrap" Foreground="White" Height="20"/>
                    </StackPanel>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
Run Code Online (Sandbox Code Playgroud)

listview listviewitem win-universal-app uwp

11
推荐指数
1
解决办法
3448
查看次数

C# 检测 Windows Phone 项目中蓝牙设备上的按钮按下情况

我有一个蓝牙手写笔设备。它上面有三个按钮:电源/通话、音量增大、音量减小。在与手写笔配对的 Windows Phone 上运行的 C# 项目中,如何检测何时按下其中一个按钮?

注意:我已经可以在代码中看到该设备:

BluetoothDevice currentDevice { get; set; }
string deviceName = "P1";
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
    foreach (DeviceInformation di in await DeviceInformation.FindAllAsync(BluetoothDevice.GetDeviceSelector()))
    {
        BluetoothDevice bdDevice = await BluetoothDevice.FromIdAsync(di.Id);
        if (bdDevice.Name == deviceName)
        {
            currentDevice = bdDevice;
            //OK, so now what do I do to listen for the button clicks???
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

c# bluetooth

6
推荐指数
0
解决办法
928
查看次数

C#UWP隐藏软导航栏

如何在我为手机编写的Windows 10(univeral windows platform)应用程序的底部以编程方式隐藏/折叠导航栏?

处理顶部的StatusBar可以通过以下方式完成:Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync();

c# windows-phone uwp

5
推荐指数
1
解决办法
2624
查看次数

在命名捕获中获取表达式

我提供了一个文本框,用于输入正则表达式以匹配文件名.我计划使用Regex方法检测它们提供的任何命名捕获组GetGroupNames().

我想得到他们在每个命名捕获组中输入的表达式.

例如,他们可能会输入这样的正则表达式:

December (?<FileYear>\d{4}) Records\.xlsx
Run Code Online (Sandbox Code Playgroud)

\d{4}除了手动解析正则表达式字符串之外,是否有一种方法或手段来获取子表达式?

c# regex

5
推荐指数
1
解决办法
98
查看次数

C#uwp应用程序阻止空闲模式

Windows Phone 8使您的应用能够阻止手机进入锁定屏幕:PhoneApplicationService.Current.ApplicationIdleMode = IdleDetectionMode.Disabled;

有人知道Universal Window Platform的等价物是什么吗?

c# windows-10-mobile uwp windows-10-universal

3
推荐指数
1
解决办法
644
查看次数