silverlight

Turn on torch with MediaCapture on Windows Phone Silverlight 8.1

流过昼夜 提交于 2020-01-05 08:32:25
问题 My problem is quite simple, I cannot turn on the flash light with the MediaCapture API from windows phone 8.1. (I succedded with the 8.0 API) I built a very simple project with 2 buttons, one to toggle the FlashControl and the other one to toggle TorchControl. There is no crash, no exception. My phones support FlashControl and TorchControl. I also debug step-by-step and everything looks good, values are changed when buttons are clicked. Here is my code: MediaCapture m_captureManager; public

Binding from View-Model to View-Model of a child User Control in Silverlight? 2 sources - 1 target

故事扮演 提交于 2020-01-05 08:29:12
问题 So i have a UserControl for one of my Views and have another 'child' UserControl inside that. The outer 'parent' UserControl has a Collection on its View-Model and a Grid control on it to display a list of Items . I want to place another UserControl inside this UserControl to display a form representing the details of one Item . The parent UserControl's View-Model already has a property on it to hold the currently selected Item and i would like to bind this to a DependancyProperty on the

Binding from View-Model to View-Model of a child User Control in Silverlight? 2 sources - 1 target

删除回忆录丶 提交于 2020-01-05 08:28:30
问题 So i have a UserControl for one of my Views and have another 'child' UserControl inside that. The outer 'parent' UserControl has a Collection on its View-Model and a Grid control on it to display a list of Items . I want to place another UserControl inside this UserControl to display a form representing the details of one Item . The parent UserControl's View-Model already has a property on it to hold the currently selected Item and i would like to bind this to a DependancyProperty on the

Accessing TextBox inside a ContextMenu

≯℡__Kan透↙ 提交于 2020-01-05 08:13:56
问题 I've got a TextBox that's part of a ContextMenu's MenuItem. However, I can't seem to access that TextBox the same way I can access other controls that are outside of the ContextMenu. Here's my XAML: <ListBox Name="ItemList"> <ListBox.Resources> <ContextMenu x:Key="listBoxItemContextMenu"> <MenuItem Header="Rename"> <TextBox Name="newFilename" KeyUp="renameFile" /> </MenuItem> </ContextMenu> </ListBox.Resources> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Setter Property=

viewmodel have to be public. How should I deal with that?

会有一股神秘感。 提交于 2020-01-05 07:57:49
问题 Pretty much it summarizes my problem here: Double check - does it ever make sense to have internal viewmodel class? I have controls.DLL and I'd like to keep this custom control bindings and viewmodel's internal. However, this doesn't seem to be possible. How do you get around that? The only way I see it - don't use bindings.. 回答1: Why do you have a view model for a custom control? I assume you're assigning the view model object to the DataContext property, but this is almost always a mistake:

How to notify an user when he tries to close a tab or close the browser

六眼飞鱼酱① 提交于 2020-01-05 07:11:22
问题 First of all, I always say the same: sorry about my english is very weak. I hope you can understand me well. I need to notify an user when he tries to close a tab or close the browser. Is there any way to fire an event to avoid the browser will be closed? The application is made in silverlight. Thanks in advance. 回答1: Take a look at the following example, there is also a sample application: http://www.blog.jonnycornwell.com/2011/01/23/using-silverlight-and-javascript-to-prevent-leaving-a

Binding ListBox to a collection of screens (widgets)

不想你离开。 提交于 2020-01-05 04:23:54
问题 Given that I have the following widget (and a view attached to it): public class MyWidgetViewModel : Screen {} I can use and display it easily in an another view. The view model "hosting" the widget looks like the following: public class WidgetWorkspaceViewModel : Screen { private Screen myWidget = new MyWidgetViewModel(); public Screen MyWidget { get { return myWidget; } set { myWidget = value; } } } And the control is shown on WidgetWorkspaceView like this: <ContentControl x:Name="OneWidget

Silverlight, datagrid, autogenerated columns on modified column change cell visibility of content

試著忘記壹切 提交于 2020-01-05 04:09:12
问题 I have a form, it has a grid. I autogenerate the columns and tweak them as required: if (e.PropertyName == "id") { System.Windows.Style style = new Style(typeof(DataGridCell)); style.Setters.Add(new Setter(DataGridCell.ContentTemplateProperty, CreateBtnTemplate(30))); e.Column.CellStyle = style; } private static DataTemplate CreateBtnTemplate(int width) { string str = "<DataTemplate xmlns='http://schemas.microsoft.com/client/2007' >" //+ "<Button Tag='{Binding id}' Content='Respond' + "

Can I play xesc file on Silverlight?

懵懂的女人 提交于 2020-01-05 04:05:10
问题 It seems very weird and I can't understand it, Why xesc, the output of Expression Encoder 4 Screen Capture, can't be play on Silverlight?? Why ScreenCaptureVideoProfile codec is always unknown? doesn't the left hand know what the right hand is doing?? 回答1: Answer from Microsoft Expression Encoder team Being optimized for screen capture, the XESC codec has dependencies that are platform dependant and thus doesn't really fit in the Silverlight model. http://social.expression.microsoft.com

Multiple screens/monitors with Silverlight

好久不见. 提交于 2020-01-05 03:59:11
问题 I'd like to write a Silverlight app that has 2 or more browser windows that "interact". An example would be a parent/details display where selecting an item in the "Parent" list (in one browser window) will display the details of the item in another window. The main point is so that on a multiple-monitor setup the user could have the main screen on one monitor and "tool" windows on the other. Like how I use VS. Is this possible? Any links/sample code etc? Thanks! 回答1: You should be able to