silverlight

How to store FontFamily as a StaticResource?

前提是你 提交于 2019-12-21 16:27:18
问题 I'm trying to figure out how to set a FontFamily in my App.xaml in such a way that I can declaratively apply that style wherever I need to. In the ResourceDictionary I can apply something like: <System:Double x:Key="SmallTextSize">10</System:Double> What I want to do then is something like: <FontFamily x:Key="MainFont">Wingdings</FontFamily> But, the only thing I can get to work is an implicit style, which requires a target, and multiple declarations of the font I want to use. I need to be

Setting Border background with a template binding

我的未来我决定 提交于 2019-12-21 14:58:12
问题 Value="{TemplateBinding HeaderColor}"I've created my own control, and I'm wondering if I can bind a Border.Background to a template property. Currently i'm setting it with a StaticResource like the following: <Color x:Key="ControlMouseOverColor">green</Color> <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="headerLayout"> <EasingColorKeyFrame KeyTime="0:0:6" Value="{StaticResource

XAML: make a ScrollViewer show scrollbars when the ScaleTransform of a child object gets big

天大地大妈咪最大 提交于 2019-12-21 12:32:33
问题 I am making a sort of "print preview" control for some documents in my Silverlight 3 application. I have a Canvas (for showing the document) inside of a ScrollViewer, and I have zoom in / zoom out buttons that control the X and Y Scale properties of the ScaleTransform for the Canvas.RenderTransform property. I want the scrollbars of the ScrollViewer to show up when I "zoom in" enough such that the canvas is no longer visible in the ScrollViewer area, but it seems that they only show up

WP7 - Using Storyboard defined in Application.Resources

家住魔仙堡 提交于 2019-12-21 12:25:38
问题 In my Application.Resources I have the following Storyboard defined. <Application.Resources> <!--Storyboard animation for fading out a UI element--> <Storyboard x:Key="FadeOutAnimation"> <DoubleAnimation From="1" To="0" Duration="0:0:0.25" Storyboard.TargetProperty="Opacity" AutoReverse="False" /> </Storyboard> </Application.Resources> In code-behind I'm using this to fade out some TextBlock s when the user taps on them. // Get the storyboard from application resources Storyboard sb =

How to implement live video broadcasting in C#?

限于喜欢 提交于 2019-12-21 12:24:54
问题 I want to plug a live video broadcasting facility to a website. I'm planning to use silverlight and C# but I'm very newbie in this topic. What is the best way to do this? Thanks in advance. Update: I have a camera. I want it to capture it and show on my website. Live. But I have no idea about what I must do inside. Tell me everything about the capturing, streams, api's, dll's, whatever else I need to know. Thanks. 回答1: If you're on Windows, you may want to consider the free Windows Media

Silverlight ValidatesOnException default message localization

烂漫一生 提交于 2019-12-21 11:54:56
问题 In my silverlight 4 MVVM application, i can switch languages during runtime : public void SetLanguage(string language) { var culture = new CultureInfo(language); Thread.CurrentThread.CurrentUICulture = culture; Thread.CurrentThread.CurrentCulture = culture; // ... } For the inputs, i just added "ValidatesOnException=true" in case of conversion problems and it does the job. But the default exception message is in the culture of my OS and not in the manually chosen one. In this thread on

Can I change Silverlight out-of-browser settings at runtime?

↘锁芯ラ 提交于 2019-12-21 11:33:54
问题 I have a single codebase that can install an OOB SL5 app in various configurations. Based on the configuration at runtime (selected by init parameters) I would like to update the OOB Settings (title, window title) prior to performing the install. It appears that the only way is through the OutOfBrowserSettings.xml file (or the Project Settings UI) at compile time. Am I missing something or is this just the way it is? 回答1: According to MSDN you can do that. To configure an existing application

Can I change Silverlight out-of-browser settings at runtime?

此生再无相见时 提交于 2019-12-21 11:32:43
问题 I have a single codebase that can install an OOB SL5 app in various configurations. Based on the configuration at runtime (selected by init parameters) I would like to update the OOB Settings (title, window title) prior to performing the install. It appears that the only way is through the OutOfBrowserSettings.xml file (or the Project Settings UI) at compile time. Am I missing something or is this just the way it is? 回答1: According to MSDN you can do that. To configure an existing application

Entity Framework for Portable Class Library

放肆的年华 提交于 2019-12-21 11:01:21
问题 I am trying to create Repository , Entity framework for Portable Class Library , when ever I try to Nuget EntityFramework it is Failed to add reference to 'System.ComponentModel.DataAnnotations'. Please make sure that it is in the Global Assembly Cache. Any Idea to resolve this for EF Compatible EF package for Portable Library 回答1: You can use fluent Api, don't use data annotations and attributes in the model class. Example: for defining a primary key; instead of using [Key] tag, use:

split ARGB into byte values

送分小仙女□ 提交于 2019-12-21 09:34:48
问题 I have a ARGB value stored as an int type. It was stored by calling ToArgb. I now want the byte values of the individual color channels from the int value. for example int mycolor = -16744448; byte r,g,b,a; GetBytesFromColor(mycolor,out a, out r, out g, out b); How would you implement GetBytesFromColor? To give the context I am passing a color value persisted in db as int to a silverlight application which needs the individual byte values to construct a color object. System.Windows.Media