|
As Pete was not very clearly hinting, you aren't allowed to access the local file system in silverlight because thats a security breach. Imagine if any web site could install a silverlight app on your machine and access your c:\documents\bank records.doc and make a copy. Not good!
If you are using SL4, there is a work-around as you can access the local file systems *IF* your app is running with elevated permissions and is trusted. Even then, you only have access to a few folders. Again, a security consideration.
In SL3 and below, you can not access the local file system at all.
|
|
|
|
|
Hi,
How to enable out of browser, elevated trust for the application and make it is trusted.
I dont know how to do it?
Thanks,
Abdul.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
You can only get at the file from a user interaction, via the fileopen dialog.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
using silverlight,actually it does not allow the client side application to fetch the data from outside the project.The data can be fetched in only two ways ,first if it is stored locally using isolated storage or its a resource file.
Enjoy
|
|
|
|
|
Curently i have downloaded expression blend trial to see what i do. I have made simple triangle.
<Path Data="M395.25,283.625 L403.75,295 C403.75,295 388.37515,294.875 388.37515,294.875 C388.37515,294.875 395.25,283.625 395.25,283.625 z" HorizontalAlignment="Left" Height="12.375" Margin="189.891,0,0,188.625" Stretch="Fill" UseLayoutRounding="False" VerticalAlignment="Bottom" Width="16.375" Fill="#FF00B6BA"/>
So my question is, is there a tool that can convert StreamPathGeomtry (Path.Data) into a normal XAML graphic no matter how complex is? I want to see how complex graphics works.
I appreciate any help.
PS: Do not convert this for me.
|
|
|
|
|
You mean convert the path into a bunch of line segments? Not sure why you want to do that. Thats the whole point of paths. By the way, that IS a "normal XAML graphic"... Paths have nothing to do with Expression Blend, they are standard WPF objects.
|
|
|
|
|
SledgeHammer01 wrote: You mean convert the path into a bunch of line segments?
That is what i meant. I know it doesn't have anything with blend.
SledgeHammer01 wrote: By the way, that IS a "normal XAML graphic"... Paths have nothing to do with Expression Blend
I didn't knew how to express it
SledgeHammer01 wrote: Not sure why you want to do that.
I may not be able to use Bleend in the future but i want to see how complex graphic comes together.
|
|
|
|
|
Ok, well, I don't think anybody really works directly with the path syntax itself because it can get pretty complicated. REALLY complex (by complex, I don't mean a triangle, I mean something along the lines of the Silverlight 5 muscle-man demo) graphics aren't a single primitive. They are thousands of primitives. I forgot the name of the user on here, but there is a guy on here that has put up 4 or 5 demos of complex WPF graphics. Anyways, if you really want to learn the syntax itself (waste of time IMO since the visual tools do it for you ), check here:
http://msdn.microsoft.com/en-us/library/ms752293.aspx[^]
|
|
|
|
|
thanks, thats the info i was looking for.
|
|
|
|
|
is it possible to set an adorner for a frameworkelementfactory object ? I have created a frameworkelementfactory of type button. I have registered the click event using addhandler method. In the button click event handler, i got the sender as the button. Then i used the below code:
AdornerLayer adl = AdornerLayer.GetAdorner(btn);
MyAdornerClass acls = new MyadornerClass(btn);
adl.Add(acls) --> // here i am getting error saying specified object is null in the index or don't use this method if VisualChildCount returns 0.
I have overrided the VisualChildCount property in my MyAdornerClass and in the get method, i returned 1.
any idea?
|
|
|
|
|
Hi guys,
I have an ftp location where i want my WPF clickonce deployment,
once i publish it from visual studio i add my ftp address into the
published location and it is published.
so no when i access this location and download the setup file at my local system to install
it gives me error and when i open the log file it says it is unable to find .application file
and the location from where it tries to find is where i have downloaded the setup file , although at ftp location the .application file exsistesm i am stuck , any help.
Regards,
Tauseef.
Tauseef A Khan
MCP Dotnet framework 2.0.
|
|
|
|
|
It is a question about WCF RIA.
A Datagrid is binding with DomainDataSource. When I add an entity to DomainContext in client, how can I update the DataGrid(add a row) without connecting to DomainService in server and reload?
|
|
|
|
|
I've solved it.
The method DomainDataSource.DataView.Add() can do this . ^^
|
|
|
|
|
Usually we use ItemSource property to set comboboxitems automatically. However, we also often hope to attach the following two options to the dropdownitems of combobox.
(None):
Sometimes we need to reset the value to none. but the itembinding combobox doesn't offer. You have to select one value.
(Add);
We also want to add a new value when the itembinding data doesn't include what we want. And we don't want to go to another page to initial this request.
I think it is a common function about combobox. but the bad thing is I can not find a good template for this.
Would anyone know about it? Thanks in advance for your help.
modified 15-Dec-11 3:01am.
|
|
|
|
|
Well, you could always do a variation of the technique I describe in my blog entry here[^].
|
|
|
|
|
The article is great . But the CompositeCollection is not included in silverlight in which my platorm is.
|
|
|
|
|
Thanks for that, but if I were you I would include vital information such as platform in future just so you don't get answers like mine.
|
|
|
|
|
I usually take a copy of the list servicing the combo and insert a couple of dummy records into the start of the list. Then you need to detect the content in the SelectedObject and deal with it when it is "Add"
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I'm looking for a possibility to read the binding expression out of a DataGridTemplateColumn's CellTemplate in code behind.
My template columns look like this:
<DataGridTemplateColumn x:Name="..." Header="...">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=City}" Style="..."/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<ComboBox ... />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
Now I want to get the value of the binding path in the datatemplate. In this case, I'like to get the value "City".
Any tips would be greatly appreciated.
Kind regards,
Nico
|
|
|
|
|
Hello,
I want to create in my project a menu like the menu in vs2008.
When you press View->OtherWindows you get a smaller sub menu
and also the options that open another menu have a small arrow next to them.
How can i do this?
Thanks.
|
|
|
|
|
MenuItem elements are hierarchical by nature, so if you were adding them through XAML, I would add them using something like the following:
<MenuItem Header="View">
<MenuItem Header="Other windows">
<MenuItem
InputGestureText="Ctrl+W, A"
Header="Command Window"/>
</MenuItem>
</MenuItem>
|
|
|
|
|
I've been a long time reader of this forum, and finally had a question I just couldn't figure out through any searches. So I signed up hoping someone would have an idea!
I am attempting to implement global hotkeys in my WPF data entry application. An example of a hotkey would be to hit F1 to save a record and move to the next record (no matter where the user has clicked, as long as it's inside the window).
Well, the functionality works correctly. When you hit F1, it saves the record. But only if you hit F1 twice. The first keypress (by observing the debugger) has an F1 KeyStates.Down value of "false". It is "true" the second time.
Here is what I've used XAML-side so far:
<Window.CommandBindings>
<CommandBinding Command="{x:Static my:MainWindow.CustomRoutedCommand}"
Executed="ExecutedCustomCommand"
CanExecute="CanExecuteCustomCommand" />
</Window.CommandBindings>
And code side:
Public Shared CustomRoutedCommand As New RoutedCommand()
Private Sub Window_Loaded(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded
Dim customCommandBinding As New CommandBinding(CustomRoutedCommand, AddressOf ExecutedCustomCommand)
Dim saveKeyGesture As New KeyGesture(Key.F1)
CustomRoutedCommand.InputGestures.Add(saveKeyGesture)
End Sub
Public Sub ExecutedCustomCommand(ByVal sender As Object, ByVal e As ExecutedRoutedEventArgs)
If (Keyboard.GetKeyStates(Key.F1) = KeyStates.Down) Then
SaveRecord()
End If
End Sub
Thanks!
-- Graham
|
|
|
|
|
[Edit: fixed typo in code]
I've recently started tinkering with Silverlight and am trying to figure out how to do something that should be pretty straightforward - i.e. display a looked up value in a DataGrid column. For the purpose of simplicity, let's assume I want to display a collection of Employee records. Each Employee contains an Id (int ) and JobId (int ). The data grid should display the employee's ID and the job name (not its ID).
The only solution I can think of is to use a value converter (JobIdToJobNameConverter) that uses a static JobsProvider class that contains the mapping of job IDs to names.
<data:DataGridTextColumn
Header="Employee ID"
Binding={"Binding EmployeeId"}>
<data:DataGridTextColumn
Header="Job Name"
Binding="{Binding EmployeeJobId, Converter={StaticResource JobIdToJobNameConverter}}">
The converter looks like this:
public class JobIdToJobNameConverter : IValueConverter
{
public object Convert
(object value,
Type targetType,
object parameter,
CultureInfo culture)
{
Job job = JobsProvider.GetJobs().FirstOrDefault
(p => p.JobId.Equals ((int) value));
return job == null ? string.Empty : job.JobName;
}
public object ConvertBack
(object value,
Type targetType,
object parameter,
CultureInfo culture)
{
return DependencyProperty.UnsetValue;
}
}
While this works, it seems there's probably a smarter solution. A gentle nudge in the right direction would be much appreciated.
Thanks,
/ravi
modified 11-Dec-11 23:48pm.
|
|
|
|
|
Ravi Bhavnani wrote: it seems there's probably a smarter solution
My first reaction to that was WTF are you doing, so I agree with you that there should be a better way.
I would look at your data source, the list of employees, that you bind to your datagrid. This probably comes from a database via a query so why not include the jobname in that original query and bind to that field.
I don't even bother binding the id fields into the datagrid as you should never actually touch the visual object when processing. You should ALWAYS use the underlying data object that it bound to the datagrid.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
My example was intentionally contrived. In doing so, I realize I left out some key information.
Assume I want to be able to display and edit the employee's job (by selecting it from an AutoCompleteBox in a GridTemplateColumn ). I'll need a JobsProvider to populate the AutoCompleteBox and was going to use the scheme I described in my original post to display the selected (and initial) job in the TextBlock in the CellTemplate . Does that sound right?
/ravi
|
|
|
|