uwp

Leaving the hamburger frame in UWP

跟風遠走 提交于 2019-12-12 02:51:15
问题 I am new to UWP development. I am trying to make a simple app to show some data. I created a hamburger menu for the first sections of my app and it works well. But, after you choose a page, it is shown on a frame I have in my hamburger menu created with SplitViews. <RelativePanel Background="{StaticResource AccentBrush}"> <Button Name="HamburgerButton" FontFamily="Segoe MDL2 Assets" Content="" FontSize="36" Click="HamburgerButton_Click" /> <TextBlock Name="TitleTextBlock" RelativePanel

UWP - StorageFile to ImageSource obeying MVVM

流过昼夜 提交于 2019-12-12 02:46:56
问题 I have multiple StorageFile s available as Task<StorageFile> s in my ViewModel, I want to bind an Image in my View to it. A BitmapImage shouldn't be made in the ViewModel, because it's in the XAML namespace and requires the UI thread (which I fail to do). How should I tackle this problem? Using a ValueConverter can't be done, as opening the StorageFile is async... PS: I can't use an URI, the StorageFile is located in the LocalCache folder... 回答1: Try just use Path property from StorageFile

c++ byte array to bitmapimage

亡梦爱人 提交于 2019-12-12 02:46:29
问题 This is my first question on stackoverflow. I'm new to UWP programming, and due to some reason I need to do it in C++. Now I'm trying to solve this problem: I've got a byte array of images and want to show them in the UI. The following code is what I've tried but seems don't work. Here is C++ code: BYTE input[160000] = ...; InMemoryRandomAccessStream ^stream = ref new InMemoryRandomAccessStream(); DataWriter ^writer = ref new DataWriter(); writer->WriteBytes(Platform::ArrayReference<BYTE>

Universal windows platform - Consuming web service, ASMX (Content type parsing)

北慕城南 提交于 2019-12-12 02:43:51
问题 I'm getting started with UWP and wish to consume an old, heavily used ASMX web service written in VB.Net 2.0. I have created a service reference to the web service but whatever function I call I always end up with the error "An exception of type 'System.PlatformNotSupportedException' occurred in mscorlib.ni.dll but was not handled in user code Additional information: MessageEncoder content type parsing is not supported." There's no further help than this, not sure if it's because the return

Trying to setup a custom DependencyObject. Clearly missing something

我的未来我决定 提交于 2019-12-12 02:43:13
问题 I have the following in a UWP app. Notice that my Element descends from DependencyObject, not from a Control, Panel, etc. But when I call the test method MessWithBindings(), the bindings are not working. The PropertyChanged method does fire, but the PropertyChangedEventHandler is null, so it doesn't do anything. Am I supposed to directly setup the event handler somehow? Or is there another call I'm missing that creates it? Incidentally, I have FrameworkElement versions of the BindWidth

The buffer allocated is insufficient when encoding to Rgba16 UWP

血红的双手。 提交于 2019-12-12 02:39:05
问题 I am encoding a Canvas control which contains Textblocks as child using the following code but I get The buffer allocated is insufficient My code using(InMemoryRandomAccessStream ras = new InMemoryRandomAccessStream()) { var displayInformation = DisplayInformation.GetForCurrentView(); var renderTargetBitmap = new RenderTargetBitmap(); await renderTargetBitmap.RenderAsync(Textify.CanvasControl); var width = renderTargetBitmap.PixelWidth; var height = renderTargetBitmap.PixelHeight; IBuffer

UWP: changing the (text) style of a ListBoxItem Element in c# code

守給你的承諾、 提交于 2019-12-12 02:37:28
问题 I have a listbox with many listboxitems inside. those items only contain text elements. What I want to do is change the text style (and maybe the background colour as well) for a single listboxitem in c# code (as I need to apply conditions). how would I go about that? XAML: <ListBox x:Name="todoList" Margin="5, 5, 5, 5" Grid.Row="1" SelectionChanged="todoList_SelectionChanged"/> I fill the listbox by parsing a file and then adding items to the listbox. Subclassing the ItemControlStyleSelector

Trouble binding XAML uwp

两盒软妹~` 提交于 2019-12-12 02:36:30
问题 Hi I am following this tutorial,http://blogs.u2u.be/diederik/post/2011/11/14/null.aspx, to bind the visibility of an element to a Boolean property. The program is not working. Here is the code: <Page.Resources> <local:BooleanToVisibilityConverter x:Key="TrueToVisibleConverter"/> </Page.Resources> <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <StackPanel> <TextBlock Text=" Hello World" Visibility="{Binding Path=Show_element, Converter={StaticResource

How to access Sqlite database file in Xamarin UWP

萝らか妹 提交于 2019-12-12 02:25:35
问题 I have a Xamarin project. In my UWP project's root, I stored a sqlite file that has initial tables my app needs. I set the ' Build Action ' to ' Content '. All examples I found look for the file in ' ApplicationData.Current.LocalFolder.Path ', but when I run the app, there is nothing in that folder. Everything gets created in Debug folder. Should I use a different path for debug and release? How does the storage work? Are apps being sandboxed in UWP? 回答1: All examples I found look for the

Get HTML source code of table with specific attribute

流过昼夜 提交于 2019-12-12 02:24:53
问题 I am trying to get the HTML source code of a table with a specific attribute. The code below will help you understand more. public static async Task GetCldInfos() { string sURL = @"https://www.investing.com/economic-calendar/"; using (HttpClient clientduplicate = new HttpClient()) { clientduplicate.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident / 6.0)"); using (HttpResponseMessage responseduplicate = await clientduplicate.GetAsync