windows-runtime

GridView Orientation with Wrapping in WinRT

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 21:11:01
问题 I am developing a WinRT app in c# , I am using a GridView to present my item. I want my items to be arranged Horizontally and then(when reached the max width) next items should be added to the new row( Simply: only vertical scroll-bars can be visible ). Unfortunately my current xaml can only add items horizontal in one row(with a horizontal scroll bar) <GridView x:Name="GridChildItem" ItemContainerStyle="{StaticResource NonTickGridViewItem}" VerticalContentAlignment="Stretch" ItemTemplate="

Getting a Type Assembly in Windows 8

风格不统一 提交于 2019-12-06 20:04:30
问题 I'm trying to use MEF in Windows 8. In order to build up my AssemblyCatalog for the container, I need a reference to the assembly. In the past, I would have just done this: var catalog = new AssemblyCatalog(typeof(App).Assembly); Mysteriously, the Assembly property no longer exists on the Type object. Anybody know of a good work around? Is there another way to get the assembly? I could load it using Assembly.Load , but I would need the name of the assembly. I can't get that from the type

Open links in external browser in WebView (WinRT)

孤街醉人 提交于 2019-12-06 19:50:17
问题 I have a WebView component that I use to display HTML Ads in my app. When user clicks an Ad in the WebView I want to open the Ad link in an external browser. How do I do that? I need something like OnNavigating from the WP7 browser. I tried the Tapped event of the WebView but it never gets called even when I set IsTapEnabled=true. I need something like 回答1: You will need to use the ScriptNotify event for this. Here's how I handled the scenario (using NavigateToString). If you're retrieving

How to close a Windows Phone 8.1 app

我的梦境 提交于 2019-12-06 19:08:06
问题 In WP7 and WP8 I just needed to clear the backstack in a page, then press Back button and the app is closed. In WP8.1 I do Frame.BackStack.Clear(), press Back and the app just minimizes.. How to kill it with Back button? 回答1: You can add, in your main page definition: Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed; Then private void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e) { if (!e.Handled && Frame

Getting a Stream from a resource file / content

自作多情 提交于 2019-12-06 18:06:32
问题 Is this the correct/only way of getting a Stream from a resource file? Uri uri = new Uri(fullPath); StorageFile storageFile = await Windows.Storage.StorageFile. GetFileFromApplicationUriAsync(uri); IRandomAccessStreamWithContentType randomAccessStream = await storageFile.OpenReadAsync(); IInputStream resourceStream = (IInputStream) randomAccessStream.GetInputStreamAt(0); All my other sources (http and local storage) return a Stream object, and it is painful to have to if-else code that uses

Building Windows 8 Metro App on Windows 7 with Visual Studio 2010

吃可爱长大的小学妹 提交于 2019-12-06 17:48:16
问题 My Visual Studio can't seem to build any of the Metro Sample applications. As I've never really used this IDE before, I've pretty much given up. Can anyone direct me to a sample application that is already built and preferably some source code along with it for reference? Note: I have a copy of Windows 7 AND 8. However I can't seem to build Microsoft's File Access Sample in my copy of Visual Studio 2010 Ultimate. I'm trying to test one of my Win7 applications in Metro mode of Win8 (the

Give Java application a Metro Look and Feel in Windows 8 [closed]

孤街浪徒 提交于 2019-12-06 17:02:42
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I have already developed a Java application which is working well in Windows XP, Windows 7 & Windows 8 consumer preview. The

how to view specific setting page in **winrt** application using C#?

倾然丶 夕夏残阳落幕 提交于 2019-12-06 15:45:25
问题 how to view specific setting page in winrt application using C# from outside button click? In javascript i found like this WinJS.UI.SettingsFlyout.showSettings("About", "/Settings/About.html") But i could not able to find this in c#,I am using callisto for Setting Flyouts 回答1: I'm using Callisto and C# too, and this is how I solved the problem. void OnCommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) { var settings = new SettingsCommand("settings", "Settings"

In metro, get all inherited classes of an (abstract) class?

自作多情 提交于 2019-12-06 15:41:39
I got stuck when trying to get all inherited classes in metro. The WinRT API is different from .net framework, so both the solutions ( solution1 and solution2 ) don't work. Any code or tool solution is appreciated. I'm still trying. I will put my solution here if success. Damir Arh This should work (based on the code from here ): public IEnumerable<T> GetEnumerableOfType<T>(params object[] constructorArgs) where T : class, IComparable<T> { List<T> objects = new List<T>(); foreach (Type type in typeof(T).GetTypeInfo().Assembly.ExportedTypes .Where(myType => myType.GetTypeInfo().IsClass &&

How do I use INotifyPropertyChanged in WinRT?

戏子无情 提交于 2019-12-06 15:34:24
问题 I'm a total newbie, just learning the basics of DataContext and the MVVM model. I've now got a grid bound to a view model object which implements INotifyPropertyChanged , however it appears that UpdateSourceTrigger (which all the WPF tutorials tell me to use) is not available for WinRT / Metro Style apps! How do I implement INotifyPropertyChanged then? I'm at the end of my tether here. I've spend nearly the whole day on the most basic of app examples, simply trying to get a grid to update