silverlight

The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range?

余生颓废 提交于 2019-12-17 09:38:41
问题 I am working on application contains a datepicker and if I set the time in that picker to a very old value or far in the future when I try to save this value in the database the server throw this exception, what is the cause of it? The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value. The statement has been terminated. 回答1: DateTime has the range: January 1, 1753, through December 31, 9999 DateTime2 has the range: 0001-01-01 through 9999-12-31 So

How Do I Give a Textbox Focus in Silverlight?

╄→尐↘猪︶ㄣ 提交于 2019-12-17 09:22:16
问题 In my Silverlight application, I can't seem to bring focus to a TextBox control. On the recommendation of various posts, I've set the IsTabStop property to True and I'm using TextBox.Focus(). Though the UserControl_Loaded event is firing, the TextBox control isn't getting focus. I've included my very simple code below. What am I missing? Thanks. Page.xaml <UserControl x:Class="TextboxFocusTest.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas

Register Background Task in Silverlight 8.1 app

跟風遠走 提交于 2019-12-17 06:16:09
问题 I'm working on an app that uses BLE to communicate with an item and I need to receive background notifications from it. I am aware of the existence of GattCharacteristicNotificationTrigger but I can't find any way to register a Background Task in a Silverlight 8.1 app. Any tip? 回答1: Registering a BackgroundTask is quite well explained here at MSDN. Here is simple example fired upon TimeTrigger and showing a Toast, the steps are (applies to both - RunTime and Silverlight apps): 1.

MVVM light - how to access property in other view model

陌路散爱 提交于 2019-12-17 06:11:30
问题 I'm using mvvm light to build a Silverlight application. Is there a code snippet that shows how to access a view model's property or command from within another view model or user control's code behind? I guess it's simple, but I somehow missed something. Ueli 回答1: You could use the Messenger to do this: Send the user in the UserViewModel: Messenger.Send<User>(userInstance); would just send the user to anyone interested. And register a recipient in your CardViewModel: Messenger.Register<User>

MVVM light - how to access property in other view model

a 夏天 提交于 2019-12-17 06:11:14
问题 I'm using mvvm light to build a Silverlight application. Is there a code snippet that shows how to access a view model's property or command from within another view model or user control's code behind? I guess it's simple, but I somehow missed something. Ueli 回答1: You could use the Messenger to do this: Send the user in the UserViewModel: Messenger.Send<User>(userInstance); would just send the user to anyone interested. And register a recipient in your CardViewModel: Messenger.Register<User>

Passing an enum value as command parameter from XAML

烈酒焚心 提交于 2019-12-17 04:44:13
问题 I want to pass an enum value as command parameter in WPF, using something like this: <Button x:Name="uxSearchButton" Command="{Binding Path=SearchMembersCommand}" CommandParameter="SearchPageType.First" Content="Search"> </Button> SearchPageType is an enum and this is to know from which button search command is invoked. Is this possible in WPF, or how can you pass an enum value as command parameter? 回答1: Try this <Button CommandParameter="{x:Static local:SearchPageType.First}" .../> local -

How to automatically select all text on focus in WPF TextBox?

隐身守侯 提交于 2019-12-17 02:39:10
问题 If I call SelectAll from a GotFocus event handler, it doesn't work with the mouse - the selection disappears as soon as mouse is released. EDIT: People are liking Donnelle's answer, I'll try to explain why I did not like it as much as the accepted answer. It is more complex, while the accepted answer does the same thing in a simpler way. The usability of accepted answer is better. When you click in the middle of the text, text gets unselected when you release the mouse allowing you to start

Bind an ImageBrush to a template with a DependencyProperty

て烟熏妆下的殇ゞ 提交于 2019-12-14 04:25:41
问题 I'm trying to create a special button that colors an image based on Foreground color from the system. The solution seems to be in using the image as opacity mask to get the color and it works when I set the image directly like this: <Grid> <Rectangle x:Name="ImageForeground" Height="48" Width="48" Fill="{StaticResource PhoneForegroundBrush}" > <Rectangle.OpacityMask> <ImageBrush Stretch="Fill" ImageSource="/icons/play.png"/> </Rectangle.OpacityMask> </Rectangle> </Grid> But as soon as I try

passing a string from one user control to a second user control via INotify wihtin MVVM

China☆狼群 提交于 2019-12-14 04:22:50
问题 I am having some issues with passing a string from one user control to a second user control via INotify. Within the view I have a listbox which is bound to a ObservableCollection of type string titled SearchHistory whenever a user types a value into a textbox which is within a user control I pass the value typed into the collection and display it within the listbox control ( somewhat of a history of terms entered). This works fine. I am now trying to select the listbox item and pass it back

Using DirectShow API from Silverlight

独自空忆成欢 提交于 2019-12-14 04:13:32
问题 We would like to leverage the codec capabilities of DirectShow from Silverlight. Is this possible? 回答1: MediaStreamSource is really the closest you will get to accessing decoders in Silverlight. You also may want to look at this project: http://directshow4sl.codeplex.com/ It is a managed re-imagined version of DirectShow. 回答2: In short (because I can't even think of a long answer) no, you can't use DirectShow in Silverlight. 来源: https://stackoverflow.com/questions/3185302/using-directshow-api