uwp

Grid generation (C# UWP)

穿精又带淫゛_ 提交于 2019-12-25 09:14:17
问题 I'm new in UWP programming. And have some question. I have JSON with data (orders). There are some count of orders. I need to generate Grids with Text fields. Now I have xaml like this: <StackPanel Height="1020" Width="350" BorderBrush="#FFFDFCFC" BorderThickness="0,0,1,0"> <Grid Height="204" BorderBrush="#FFFBF8F8" BorderThickness="0,0,0,1"> <TextBlock x:Name="date1" HorizontalAlignment="Left" TextAlignment="Center" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="350" Height="50"

How do I get rid of unwanted padding in a Listview row

拈花ヽ惹草 提交于 2019-12-25 09:07:29
问题 I am trying to figure out how to get rid of the padding below the text in a listview row: And my markup for the Listview: <ListView ItemsSource ="{Binding AllowedApplicants}" Height="250" Width="219" VerticalAlignment="Top" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Margin="20,5" BorderBrush="Bisque" BorderThickness="2"> <ListView.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding}" Padding="5,5" /> </DataTemplate> </ListView.ItemTemplate> </ListView> I can't figure out where this

In UWP StreamSocket, can I read data with timeout and leave the connection open if timeout elapses

回眸只為那壹抹淺笑 提交于 2019-12-25 09:05:54
问题 As I couldn't find any way to peek for data (read data without consuming the buffer) as asked at How to peek StreamSocket for data in UWP apps I'm now trying to make my own "peek" but still no luck. I don't see how I can read data from StreamSocket in the manner which will let me use timeouts and leave the connection usable in case if timeout elapses. In the end, the problem is as follows. In my, let's say, IMAP client, I get response from a server and if this response is negative, I need to

How to store a .wav file in Windows 10 with NAudio

情到浓时终转凉″ 提交于 2019-12-25 09:04:48
问题 I'm trying to store my 16000hz 16bit mono PCM audio bytes to a wav file in a Windows 10 app. NAudio normaly has a WavFileWriter, but it seems to be gone in the Windows 10 version. I can only seem to find access to new WaveFormat(16000, 16, 1); from https://www.nuget.org/packages/NAudio/1.7.3/ Is there a stream I can use to create the Wav file or its bytes? 回答1: I suspect that NAudio removed WavFileWriter because there's now a substitute in the standard UWP API, in the Windows.Media.Audio

AppBarButton Visibility is not set

≡放荡痞女 提交于 2019-12-25 08:58:53
问题 I have troubles with setting AppBarButton visibility in codebehinde. There is my XAML: <Page.BottomAppBar> <AppBar Background="{ThemeResource AppBarBackgroundThemeBrush}"> <StackPanel Orientation="Horizontal"> <AppBarButton Icon="Save" Label="Uložit" x:Name="AppBarButtonSave" Click="AppBarButtonSave_OnClick" /> <AppBarButton Icon="Mail" Label="Odeslat" x:Name="AppBarButtonMail" Visibility="Collapsed" /> <AppBarButton Icon="Clear" Label="Zrušit" x:Name="AppBarButtonCancel" Click=

Accurate scrollbar control in an ItemsControl with a VirtualizingStackPanel

被刻印的时光 ゝ 提交于 2019-12-25 08:58:37
问题 I have an Itemscontrol using a VirtualizingStackPanel to display a huge (and growing) list of items: <ItemsControl Grid.Row="1" Name="ConversationItemsControl" VirtualizingStackPanel.VirtualizationMode="Recycling"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel Orientation="Vertical" /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.Template> <ControlTemplate TargetType="ItemsControl"> <ScrollViewer> <ItemsPresenter /> </ScrollViewer> </ControlTemplate>

UWP: allow XSL transformation in a WebView for local content

╄→尐↘猪︶ㄣ 提交于 2019-12-25 08:55:23
问题 I want to display a local XML file on a WebView . The XML file references a local XSL file (in the same folder). But the stylesheet is not applied and the reason for this seems to be security concerns. If I open the file in the console of Edge I get XSLT8690: The system cannot locate the object specified. Is there a possibility to allow the XSL transformation of a local file (e.g. like here)? How can I display a local XML file, which references a stylesheet? 回答1: If your XML and XSL file are

Creating a file/folder in UWP

谁都会走 提交于 2019-12-25 08:47:52
问题 first of all I really hope I'm not asking already answered question, I did my research on stack overflow and beyond and so far didn't find answer to my question. I finally accomplished that my Universal windows (10) app makes a project folder for user, inside LocalState folder, but its fine as long as it stays there. Now, I'm trying to generate some simple text file and save in "Project" folder, example path: LocalState\Project1\example.txt. I tried with following code: StorageFolder mapa

Making something like Fragment in UWP

微笑、不失礼 提交于 2019-12-25 08:35:05
问题 I writing app for UWP. I have app very similar to Windows 10 Mail app. I have this UI Here is xaml of this screen <Grid BorderBrush="White" BorderThickness="1"> <Grid.Background> <ImageBrush Stretch="Fill" ImageSource="Images/Background.png"/> </Grid.Background> <Grid HorizontalAlignment="Left" Height="720" VerticalAlignment="Top" Width="60" BorderBrush="#FFF5F1F1" BorderThickness="0,0,1,0"> <Button x:Name="MenuButton" Content="" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment

Set bindings for custom DependencyObjects

余生颓废 提交于 2019-12-25 08:23:31
问题 This is a continuation of a question here: Trying to setup a custom DependencyObject. Clearly missing something. It's not practical to edit the original question; changes are too great. So I'm starting a fresh question. I'm trying to setup bindings between custom DependencyObjects in my UWP app. The relevant code is below. I am seeing calls to ActualWidthPropertyChanged, but they are not triggering any call to WidthPropertyChanged. What am I missing? class WindowsElement: DependencyObject {