Silverlight - Multiline textbox - Alt + Enter Issue

I am stuck with the small issue... I am using Silverlight. I have a textbox with multiline property true. and i want the facillity that when user press "ALT + Enter" then cursor should move to the next line. I have already set the properties like AcceptsReturn, TextWrapping. But it is not working :( Can anyone please shed some light on this? Thanks, Mahesh Here is sample code: Style x:Key="MultilineTextBoxCellStyle" TargetType="TextBox"> Setter Property="AcceptsReturn" Value=

Convert C# Silverlight App To AZURE CLOUD Platform?

I've been following Brad Abrams Silverlight tutorial on his blog.... I have tried following Brads "How to deploy your app to the Cloud" tutorial however i'm struggling with it, even though it is in the same context as the first tutorial.... The Question Is the application structure essentially the same as the original "non-cloud based version"!? If not, which parts are different? (I get that there is a Cloud Service project added to the solution) - but what else?! Connection String Issue In

User Control Data Binding in Silverlight/MVVM

Do DependencyPropertys default to two way binding? If not how do you specify? The reason I ask is that I have the following user control which is causing me problems... <UserControl x:Class="SilverlightApplication.UserControls.FormItem_TextBox" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <StackPanel Style="{StaticResource FormItem_StackPanelStyle}" > <TextBlock x:Name="lbCaption" Style="{Stat

Silverlight how start implement MVVM pattern

======= So i decide to to develop my asp.net site into Silverlight. I today start to search articles about MVVM pattern which i want use in my Silverlight app, and i am confused :/ It's hart to me understand how works this pattern. I am find 3 frameworks which supports MVVM pattern in Silverlight - Caliburn, MVVM Light Toolkit and GoodLight. Should i start from own implementation of pattern or use framework? Is this frameworks only a project solutions in which i can insert my code? Whic

Silverlight Remove focus rectangle from ListBox item

How do you remove the focus rectangle from a silverlight ListBox? I have this code: <ListBox x:Name="MyListBox" > <ListBox.ItemTemplate> <DataTemplate> <Grid > ...snipped... </Grid> </DataTemplate> </ListBox.ItemTemplate> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Setter Property="HorizontalContentAlignment" Value="Stretch" />

Remove Silverlight Animation

I have a problem with my Silverlight animation that I can't seem to fix. The problem seems to be well established, but the techniques used to solve it don't seem to work in my case. Here is the storyboard code that I am using to animate a grid called "underGrid". underGrid is a base grid which I am applying a scale and location offset to in response to mouse input from the user, so that they can scale and move the grid in real time. The ResetGrid storyboard below simply animates from the curren

Silverlight open source font replacement for Segoe

I'm currently building a LOB application in Silverlight 4. I've been considering the question of typography for the application. After some experimentation on the design side the font that people like is Segoe UI. Now I can embed this font and although the font is freely available in Windows we don’t have distribution rights for this font. I am looking for an open source font visually equivalent of the Segoe family that can be freely distributed. Does such a font exist?

Silverlight How to assign Image Uri in a custom Control

I want to place an image inside my custom control , so my generic.xaml looks like below: <Style TargetType="local:generic"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:generic"> <Grid Background="{TemplateBinding Background}"> <Rectangle> <Rectangle.Fill>

Getting unhandled exception when DataTemplate is created dynamically using Silverlight 3.0

Requirement is to create a reusable multi-select combobox custom control. To accomplish this, I am creating the DataTemplate dynamically through code and set the combobox ItemTemplate. I am able to load the datatemplate dynamically and set the ItemTemplate, but getting unhandled exception (code: 7054) when combobox is selected. Here is the code Class MultiSelCombBox: ComboBox { public override void OnApplyTemplate() { base.OnApplyTemplate(); CreateTemplate(); }

Allowing item selection indicator in ListBox to overlay all items in Silverlight

I have a ListBox that uses a WrapPanel for its ItemsPanel, a custom ItemTemplate, and a custom ItemContainerStyle. The ItemContainerStyle's template contains a selection box that shows up when an item is selected. The graphics designer would like this selection box to overlap sibling items in the ListBox like it's an overlay. The first thing I tried was setting the Canvas.ZIndex property of the ItemContainer in the Selected state. That did not seem to have an effect. Then I read that list i

Silverlight What's the concept behind INotifyPropertyChanged?

All the examples of Silverlight using MVVM use interface named IPropertyChanged. What is the concept behind it and why do we need to raise an event whenever we set some value? Eg:- public class UserNPC:INotifyPropertyChanged { private string name; public string Name { get { return name; } set { name = value; onPropertyChanged(this, "Name"); } } public int grade; public int Grade { get { return grade; } set { grade = value; onPropertyChan

dialogs must be user-initiated - RadUpload control of telerik for silverlight 4

I am upgrading my application from silverlight 3 to silverlight 4 and using latest telerik binaries which is for silverlight 4, I have one issue in RadUpload. When RadUpload.ShowFileDialog(); method called it will through the error as follows System.Security.SecurityException: Dialogs must be user-initiated. Can anyone help me out in this issue? Thanks in Advances Bhushan Deshmukh

Silverlight 4: Business Application Template

I am developing a Silverlight 4 application which is based upon Business Application Template. I am interested to ask user to login and display a login form as soon as user arrives to my site. I need to makes sure that the user cannot see/navigate to any other page of the application until he/she logs in. How can I achieve this functionality?

Silverlight Setting focus to a textbox on load of Windows Phone 7 app

I have a TwoWay data-bound textbox inside my page. I want to do something pretty simple, but I can't for the life of me work out how to do it. When the page loads, I want to set the focus to the textbox if it doesn't have any text in it. protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { if (tbSearch.Text == "") tbSearch.Focus(); } This doesn't work. It doesn't fail, it just doesn't do anything. Am I doing something strange wrong? I've also tr

Manually set Validation error on Silverlight control

I have a ComboBox which I cannot bind directly to (due to this bug), so I set it's SelectedItem from a Behavior I've written. Now, if the property bound to my behavior's SelectedValue (instead of the ComboBox's SelectedValue) is invalid (e.g. nothing is selected in the comboBox, when there should be), I want to notify the ComboBox to "go red", and display an errorcode. I know this is something the Binding system (if NotifyOnValidationError=true) handles automatically (it sets the bound control's

Silverlight JetPack Theme Toolkit errors

After creating a new Silverlight application from the JetPack theme template that was installed, I try to follow the instructions provided in the App.xaml file about how to enable themeing of silverlight toolkit controls, <!-- <ResourceDictionary Source="Assets/ToolkitStyles.xaml"/> To extend this theme to include the toolkit controls: 1. Install the Silverlight Toolkit for Silverlight 4 2. Add a Toolkit control to your projec

Silverlight ClientHttp WebRequest timeout

I have a silverlight 4 application using the ClientHttp stack to make a WebRequest which serves a binary stream. I then read from this stream and do stuff. However, I have the following problem: the server buffers the data that it sends down, so that the send process is like send-pause-send-pause-send... Sometimes the server takes a little longer pause (around 20 seconds), at which point the connection seems to somehow break. I don't get any exception in Silverlight, actually to the code it lo

Is there any way to instantiate a 'Type' in Silverlight XAML?

It's well known that Silverlight lacks the very compelling x:Type MarkupExtension (MarkupExtension is not supported in Silverlight at all). Is there any dynamic workaround for it? What about enums (x:Static)? My need is to have a CommandParameter set to a Type or Enum value, neither of these are supported in Silverlight!

OpenFileDialog in SilverLight?

I have download the code for OpenFileDialog (File Upload function) from Silverlight tutorials website. I am creating a silverlight application using ESRI API and I would like to incorporate the file upload functionality in to it. I have replicated the exact code in to my application there are no errors when I run it, but for some reason my application dosen't execute this line of code "c.OpenWriteAsync(Ub.Uri)" Edit 2: I notice another thing when I upgraded the general handler (receiver.ashx) w

Silverlight MediaElement

Am new to Silverlight. Have added the MediaElement and Placed the Media file(.wmv format) with .xap file . ,Media Element is not visible . I want to know how can i Make it Visible on the application run...

Silverlight How to copy some part of WriteableBitmap?

I have some WriteableBitmap object. Lets say that the image that is actully on the WriteableBitmap object is 600x400. I want to copy part of the image - some Rectangle ( for example Rectangle of 100x100 in the middle of the WriteableBitmap ) and paste the copy to some other image control. How can i do it ?

Silverlight How to create a bitmap image programmatically when its source is an image with Build Action = Resource?

How to create a bitmap image programmatically when its source is an image with Build Action = Resource? When I try the following I get an invalid URI exception :( BitmapImage image = new BitmapImage(new Uri("/MyAssembly;component/Images/MyImage.png")); I'm using silverlight 4 and this code is inside one of the many projects of my solution (it's a silverlight class library and not the silverlight application).

Silverlight HorizontalAlignment not working

I'm trying to set an Image HorizontalAlignment property in code, not XAML, but it fails to work: Grid grid = new Grid(); grid.ColumnDefinitions.Add(new ColumnDefinition()); grid.ColumnDefinitions.Add(new ColumnDefinition()); Image img = new Image() { Source = new Uri("myImage.png") }; Grid.SetColumn(img, 1); img.HorizontalAlignment = HorizontalAlignment.Right; grid.Children.Add(img); This code should create a grid with a single row and two columns, then the image should be added to the sec

Silverlight tell the difference between moving an item within an observablecollection and inserting an item

I have an ListboxDragDropTargetbound to an ObservableCollection The user has two ways to interact - The items in the listbox can be reordered - Add a new item by dragging it in there from another listbox I have not yet found a way to distinguish these two events in code as I wish to treat them differently (send a different command) I tried: - subscribing to the ObservableCollection.Collectionchanged event - subscribing to the Drop vs ItemDroppedOnSource events of the ListboxDragDropTarget

How to remove one or more fields from the DataForm.Validating() event in Silverlight 4?

I have a data form that is bound to an object whose properties are decorated with System.ObjectModel.DataAnnotation attributes for validaton. The problem I am facing is that some properties of this class are only conditionally needed and do not need to be validated. For example when an admin of the app decides to edit a user, he or she may enter a password/password confirm/password question/password answer. Or he/she may entirely skip those properties. So if the admin decides to enter any of t

Is there any support for mouse wheel and Apple track-pad in Silverlight 5?

One of my Silverlight applications has some users to use it on Apple Macs. They complain that the mouse wheel and track-pad don't work. From the research I've done, it seems that this isn't supported in browser-hosted applications on Macs. Does Silverlight 5 add improved support? Is it on Microsoft's radar for a future version of Silverlight?

Service Model in Silverlight

What is the best model for using services in a silverlight application? I usually add a wcf service to my ASP.net app and add a service reference to my silverlight application, but anytime I change my service I should update the service reference in silverlight app. Is there any better and more professional way?

Silverlight How can I provide the ServiceURI constructor parameter when instantiating a DomainContext declaratively?

I am trying to use RIA in my Silverlight app to pull down data. The twist is that The URI for server side part of the RIA connection (WCF endpoint) is not on the same web server that served up the web page with the XAP on it. I've seen that in code I can use the constructor for the DomainContext to specify a different ServiceURI as follows: SomeDomainContext context = new SomeDomainContext(new Uri("http://blah.com/Something.svc")); SomeGrid.DataContext = context.SomeObjects;

Silverlight textblock not wrapping when there are trailing white spaces

I recently found out that a silverlight textblock won't wrap lines if the Text property holds a string with many trailing white spaces; if you trim the string, the text is correctly formatted. Do you know if this is a known bug? To reproduce the problem, try this: <Grid Width="200" Height="100"> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid Background="LightBlue"> <TextBlock Text="Lorem ip

Storing Original Values of Form using Silverlight MVVM

I am facing a problem storing original values of a form. I have a form with number of Text boxes.All these textboxes binds with a single Entity. For e.g. Class Car { private int Light; private int TailLight; private int Seats; private int Gears; } Now one text box will bind with Light, one with TailLight and so on. On page load these text boxes are filled with some values, and user has an option to edit these text boxes and save the data. Now before saving these data

Silverlight Visualize route knowing GPS locations

I have data from GPS tracking device. Data looks like pings every 5-15 minutes containing Lat/Lon. I can display points on map and that will kind of show how object was moving but it is not ideal. I'd like to "connect the dots" and show route. I realize that it may not be accurate, but still. So, what is the best way to show line betwen 2 points on bing map? I don't want straight line, I want driving line. I was thinking about navigation API, but what if I have like 200 points?

Silverlight TabItem Visibility not changing

I have a TabControl with many TabItems binding to a ViewModel that has properties for each TabItem's Visibility. <sdk:TabControl> <sdk:TabItem Name="Inventory" Header="Inventory" Style="{StaticResource TabItemStyle}" Visibility="{Binding Permissions.Inventory, Converter={StaticResource PermissiveVisibilityConverter}, ConverterParameter='Viewer'}" DataContext="{Binding VM}" /> </sdk:TabControl> All TabItems are defaulted to a

change the visibility of silverlight control's parent node, the silverlight control got reloaded

I am trying to hide a silverlight control in html. The problem is if the code of hiding is called by silverlight control, after the we make it visible again, the silverlight got reloaded, all the data in silverlight control would be lost. the following is a simple sample which can show you the problem. silverlight control: mainpage.xaml <Grid x:Name="LayoutRoot" Background="White"> <Button Content="Hide" Height="23" HorizontalAlignment="Left" Margin="118,210,0,0" Name="button1

Silverlight Frame.Navigate under the hood?

When I use Frame.Navigate(...) it seems the pages I navigate to and from are only initialized one time. (The constructor is only hit the first time I navigate to a specific page). The next time I hit a page I have already been on, the page is already "in memory"... Why is that ?

displaying single object list in two different listbox through Silverlight MVVM pattern

I am creating an application for Windows Phone. I am using Panorama view for the main page. The panorama view contains two panorama items each consist of a listbox tied to a datasource (i.e. in-memory collection using ObservableCollection). The object has 2 boolean properties IsA and IsB. I want to display the object's string data in two list, but the data is differentiated by the boolean variable. That is, if IsA is set true then object must be displayed in list box of panaroma item 1 and if I

Silverlight, path through TemplateBindings of UserControls

I have a MainPage.xaml with a TextBox (Binding TextBoxText) and some nested UserControls, which all have a TextBox with a TemplateBinding / Binding too (4 TextBoxes). I would like have the same text in every box, when I change the text somewhere. The solution: Link What could I do to synchronize all texts? Thanks! MainPage.xaml (TextBoxText is the one, which I like to display everywhere) <myContDll:DefaultContainerTemplate Caption="NewCaption"> <StackPanel x:Name="myStackPanel"

Silverlight DateTime.Today value changed when sending to the server

I am working with Silverlight and I am getting a problem. In my Database I have stored some dates with a format like this yyyy/mm/dd 00:00:00, which means that I store only the year, month and day, getting the time to 00:00:00. When the client performs an action and sends to the server I get the DateTime.Today which will keep the format of my database date, but when it is sendind I get yyyy/mm/dd 22:00:00, so when my server side function gets the date, it will return no values from the database

How to use .js and .css file in SilverLight application

I am using a customized alert message for my whole application which generates from a .js file and a .css file. I have also used silverlight in my application and shows MessageBox from silverlight with its default design. Now i want to customized that MessageBox in silverlight. So, can anyone plz help me to know how to add js and css file to silverLight application and how to use it

data of child window does not refresh while it is open mvvm in silverlight

I have a child window and there are a radgrid view and textboxes which show the radgridview items as I select a row of gridview!and i'm using mvvm pattern. when I open the child window it automatically show the data of last row as selected row in default but when I select another row although my bindings model are changed,the data in textboxes does not change while child is open!!!

Negative values in my PivotView's PivotViewerNumericProperty (Silverlight 5)

I have a pivot viewer that I added a numeric viewer property to. When the values are all possitive, it works fine. When the values are negative, I get an error: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; MS-RTC LM 8; InfoPath.2; .NET4.0C; .NET4.0E) Timestamp: Thu, 23 May 2013 14:20:57 UTC Message: Unhandled Error in Silverlight Application StartIndex cann

Silverlight URL Issue in Silver Light. Donot show .xaml path

I have a silver light application. When I run it then its URL is like http://localhost/Myfirstapplication.aspx I have created another silver light application. Mostly code is copied from first application. But when I run it then its URL is like http://localhost/mysecondapplication.aspx#loginpage.xaml. Actually I donot want to show .xaml path/name. Can any body tell me what setting should I made to hide .XAML or am I missing somthing ???

getting reference error in my first silverlight application

I have getting reference error, The type or namespace name 'ContextMenu' does not exist in the namespace 'System.Windows.Controls' (are you missing an assembly reference?) but i have already add reference from, C:\Program Files (x86)\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\System.Windows.Controls.dll please help me to solve this problem Thanks

Silverlight Ria services Acces To Operation was denied

Currently we have a silverlight application that works out of browser, somethimes the silverlight application cannot connect to the server via the RIA services, if I log the error on the server I get following error: Access to operation 'XXXX' was denied.: at System.ServiceModel.DomainServices.Server.DomainService.ValidateMethodPermissions(DomainOperationEntry domainOperationEntry, Object entity) at System.ServiceModel.DomainServices.Server.DomainService.ValidateMethodCall(DomainOperatio

Silverlight transparent textbox background

I have a RadGridView (from Telerik) and I'm trying to be able to select the content of a cell. So I have a cell template : <telerik:GridViewDataColumn Header="{Binding Source={StaticResource ResourceStrings}, Path=ResourceStrings.Value}" DataMemberBinding="{Binding Value}" UniqueName="Value" Width="2*"> <telerik:GridViewDataColumn.CellTemplate> <DataTemplate> <TextBox Text="

Silverlight calling webapi behind firewall

Silverlight application is sitting on a server which is accessible from internet and WebApi is sitting on a server behind firewall which is not accessible via internet but can be accessible via intranet. Both Silverlight Application Server and WebApi Server can talk in intranet. Is it possible for Silverlight application which is accessed from internet to talk to WebApi?

  1    2   3   4   5   6  ... 下一页 最后一页 共 60 页