windows-8

Why does TextBlock trims ending spaces from the text?

安稳与你 提交于 2019-12-04 23:13:46
Here is my TextBlock s <StackPanel Orientation="Horizontal" Margin="0,3,0,0"> <TextBlock Text="6 or more characters, at least one letter and a number, " FontFamily="Segoe UI" Foreground="#000000" FontSize="13"/> <TextBlock Text="no symbols" FontFamily="Segoe UI" Foreground="#000000" FontSize="13"/> </StackPanel> And here is the output (screen shot) Why TextBlock trims ending spaces? However it works fine when I give leading spaces. It looks like xml:space="preserve" should do the trick (see Preserving Whitespace in XAML ) but that doesn't seem to be working in a Windows Store app (it does in

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

坚强是说给别人听的谎言 提交于 2019-12-04 23:06:06
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 application may be called for use during a user's session in a given Metro app). Metro Apps (that is,

Page constructor gets called again when navigating back in Windows 8 C# App

孤人 提交于 2019-12-04 22:54:32
问题 I have found that in Windows 8 apps, a Page's constructor always gets called again when navigating back to this page, however this is not the case in Windows Phone 7 apps. Because of this behavior all the properties of that page get lost and you need to somehow store them and reassign them after the page is reactivated. At the moment I am using the SaveState method to save the data and reassign the data in LoadState method. Both of the methods are built-in in the sample Grid/Split App. I

How to detect if the surface keyboard is attached?

百般思念 提交于 2019-12-04 22:51:17
问题 I need to implement certain functions only when the keyboard is attached to the surface. Is there a way I can detect when the surface keyboard is attached or removed ? I tried this code on Surface: function getKeyboardCapabilities() { var keyboardCapabilities = new Windows.Devices.Input.KeyboardCapabilities(); console.log(keyboardCapabilities.keyboardPresent); } The result was always '1' even when the keyboard was not connected. 回答1: I used this code to identify when a keyboard is connected

Crop image with dynamic rectangle coordinate

这一生的挚爱 提交于 2019-12-04 22:48:42
I have a Image and I want crop it by using a rectangle, code below is the code I put a image and draw a rectangle at middle of the image: MainPage.Xaml: <Canvas x:Name="canvas" HorizontalAlignment="Center" VerticalAlignment="Center" Width="340" Height="480" Background="Blue"> <Image x:Name="photo" HorizontalAlignment="Center" VerticalAlignment="Center" ManipulationMode="All"> <Image.RenderTransform> <CompositeTransform/> </Image.RenderTransform> </Image> <Path Stroke="Black" StrokeThickness="1"> <Path.Data> <RectangleGeometry Rect="0,0,340,480"/> </Path.Data> </Path> </Canvas> I able to move

Windows 8 & MySQL? What are my options?

大城市里の小女人 提交于 2019-12-04 22:41:34
I am currently writing a Metro application and I want to integrate managed SQL handling within my app by connecting it to my web SQL DB. What are my options for .NET 4.5? Also, if you downvote, please explain why, I know there is some MySQL connector for .NET 4, but it is obviously incompatible with 4.5 I strongly advise against client programs connecting directly to a database server over the Internet, for the following reasons: Client libraries are designed and built around the assumption that the database is under a few miliseconds away, especially very chatty protocols (MSSQL is amongst

sqlite in windows runtime component

北城余情 提交于 2019-12-04 22:12:56
am trying to use sqlite in a windows runtime component. But I get some 219 errors when i add the nuget sqlite-net package. couldnt figure it out anywhere. Any similar issues ? I finally used a store app class library to use sqlite and called those methods in it from my windows runtime component. method in store app public async Task<IEnumerable<TaskGroup> > GetTaskGroup() { return await conn.QueryAsync<TaskGroup>("select * from TaskGroup"); } calling method in win runtime component public IAsyncOperation<IEnumerable<TaskGroup>> GetAllTaskGroup() { return m_objDAL.GetTaskGroup()

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

社会主义新天地 提交于 2019-12-04 21:44:24
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 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", new UICommandInvokedHandler(showSettings)); args.Request.ApplicationCommands.Add(settings); var credits =

Relay Command in windows 8 windows store app

故事扮演 提交于 2019-12-04 21:19:23
问题 Is there a version of RelayCommand, since CommandManager is not available in win8 metro apps? 回答1: There is a version here. using System; using System.Diagnostics; #if METRO using Windows.UI.Xaml.Input; using System.Windows.Input; #else using System.Windows.Input; #endif namespace MyToolkit.MVVM { #if METRO public class RelayCommand : NotifyPropertyChanged, ICommand #else public class RelayCommand : NotifyPropertyChanged<RelayCommand>, ICommand #endif { private readonly Action execute;

PhoneApplicationService.Current.State equivalent in windows 8

泄露秘密 提交于 2019-12-04 20:18:23
I am looking for equivalent class in Windows 8.x. API for PhoneApplicationService.Current.State which we found in Windows Phone API. Basically, I am trying to persist simple object data between pages with in session. Or is there any other option in Windows 8 to achieve this? I won't recommend using the State, it's much easier to use just IsolatedStorage for preserving data both between sessions and pages as well, to keep is simple. All data should be saved in ApplicationData.Current.LocalSettings or IsolatedStorageSettings.ApplicationSettings in case they are simple objects like string, bool,