|
Hi,
Could you please share sample code that would really help me a lot.
and one more doubt: to get the city list there is one function written in .svc class, it is returning Generic List so how to convert that to objectCollection...
Thanks & Best Regards
Shwetank
|
|
|
|
|
I have an SL 5 app that the user can drop files and directories into.
When launched from the debugger, it works as expected.
When I try to use the xap in a page on a remote site, I get a Security exception.
foreach (FileInfo fi in files)
{
// _files.Enqueue(fi);
if (fi.Attributes == FileAttributes.Directory)
Attaching the debugger to the browser, I see:
+fi.Attributes 'fi.Attributes' threw an exception of type 'System.Security.SecurityException' System.IO.FileAttributes {System.Security.SecurityException}
"File operation not permitted. Access to path '' is denied."
UPDATE: Some properties of the FileInfo object are available, but not things like Attributes, Directory, DirectoryName.
1) Why does it work when started from the debugger?
2) How can I get it working outside of the debugger?
Thanks for any insight....
modified 8-Apr-13 10:14am.
|
|
|
|
|
The OP contains the exception I see when attaching the debugger to the browser.
Certain properties of the FileInfo appear to be unavailble -- Attributes, Directory, DirectoryName -- when running outside of the browser.
|
|
|
|
|
As Colin mentioned (sort of ), this is Silverlight. It runs in a locked down sandbox environment and does not have access to local resources (files, registry, etc.). If you want to have access to those types of things, you need to specify that you want elevated permisions in your config file.
|
|
|
|
|
Thanks for the reply.
A hint on how to specify the elevated permissions would be appreciated...
(Weird: when I build and run the project -- from the debugger -- on a different computer, the app does not have elevated permission. Trying to figure out the difference between the two computers.
I have this code in a handler for the MainPage Loaded event:
Msgs.Text = string.Format("{0} ElevatedPermissions", (Application.Current.HasElevatedPermissions ? "Has" : "Does NOT have"));
)
|
|
|
|
|
My google foo is failing.
I have a treeview with a HierarchicalDataTemplate made up of a user control, in the UC I have a textbox where acceptreturn=true. When the user presses enter while editing the textbox the treeview grabs the enter key event.
How can I force the enter key press event down to the textbox?
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Idiot - e.handled = false on the keydown event
private void EnterDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
e.Handled = false;
}
}
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The enter key only passes to the UC when there are no child nodes
Using the Telerik grid so I will go annoy them b/c I think it is control specific!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The tree view is kinda weird in that some messages get funneled up the parent nodes until it reaches the root. Some other messages are eaten by the parent nodes. Have you tried using the preview events? You can usually get those consistently... except when you can't.
|
|
|
|
|
SledgeHammer01 wrote: except when you can't
Your reply instils me such confidence! I dumped it into the telerik forum, they tend to give pretty good support if a little slow lately.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Haha... probably more of a treeview control issue since its weird with the keyboard. That's why I said what I did. Some keys work one way and other keys work a different way.
|
|
|
|
|
Are there known issues with WPF GDI with Windows XP? I have a bunch of observations of a legacy WPF application that we have only on XP but works fine with Weven and others.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
WPF is flakey on XP. Known issue.
|
|
|
|
|
WPF is fine on XP ... when there are issues, it's because of crappy graphics cards (in my experience).
WPF uses DirectX; the graphics card needs to support some minimum level of DirectX.
|
|
|
|
|
Not true. XP uses a completely different rendering mechanism then Windows 7. By default WPF on XP is software only. On Vista / Win7 its hardware accelerated.
|
|
|
|
|
|
Cool link. What's your point? Have you ever tried retrieving the rendering tier on XP?
|
|
|
|
|
Since you still don't "get it", we're done.
|
|
|
|
|
It's not GDI in WPF. Do these XP machines have NVidia cards in them by any chance? The NVidia drivers were flaky as dammit on XP. Also, the WPF stack took some major improvements in WPF 4 on W7.
One thing to do - find out if the WPF app is performing software or hardware rendering on your XP box. Have a look at this[^].
|
|
|
|
|
<pre lang="css">We have a Datagrid, as Show in the Above Image.
The 1st Row in the Datagrid in a Parent Record, on ComboBox selectionChanged event. the Two records are being populated as ChildRecords.
The FirstColumn in the DataGrid is a Combobox and its selectedValue comes from a Field, ItemId.
The problem is happening when The Grid is binding with the Child Records, the Combobox selection is always happening to be the Last ItemId for all Combobox's in this Column.
The result required:
The Each ComboBox in each Row should have the SelectedValue as of its own Record Set.</pre>
|
|
|
|
|
I need help to find (or make) a control for windows environment (xaml/wpf) that scroll up automatically lines of text in a specific speed. vertical scroll.
like a News Scroller of news sites...
thanks.
|
|
|
|
|
|
Hi,I am having one problem related to ComboBox of DataGrid. Data is binding but it is not showing in the ComboBox after binding. My xaml code is like below.
<my:DataGridTemplateColumn Header="UsgSrc">
<my:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ComboBox Name="cbUsgSrc"
ItemsSource="{Binding Source={StaticResource UsgSrcUOMS}}"
SelectedValue="{Binding Path=UsgSrc}"
SelectedValuePath="UtType"
DisplayMemberPath="UtType">
</ComboBox>
</DataTemplate>
</my:DataGridTemplateColumn.CellTemplate>
</my:DataGridTemplateColumn>
I am assigning the data to combo box in the code behind like below.
<pre lang="c#"> ObjectDataProvider UsageSrcUOMS = null;
UsageSrcUOMS = (ObjectDataProvider)FindResource("UsgSrcUOMS");
UsageSrcUOMS.ObjectInstance = objUtView;
Microsoft.Windows.Controls.DataGridCell cell = obj.GetCell(dgMtrHdr, J, 11);
if (cell != null)
{
ContentPresenter panel = cell.Content as ContentPresenter;
if (panel != null)
{
ComboBox cmbUsUtilit = obj.GetVisualChild<combobox>(panel);
cmbUsUtilit.IsEnabled = true;
if(objUtView!=null)
cmbUsUtilit.ItemsSource = objUtView;
cmbUsUtilit.SelectedIndex=2;
}
}
Please help me why the data is not displaying in the combo box after binding.
|
|
|
|
|
Your XAML declares a StaticResource for the binding, which does not exist at load time; see the discussion here[^].
Use the best guess
|
|
|
|
|
Hi Guys, I have a nice working app in Windows Forms. I am attempting to port it to WPF and I am stuck with selecting a row and getting a value from one of the columns.
Apologies for the long code:
In Windows Forms App I do the below:
private void lstFiles_DoubleClick(object sender, EventArgs e)
{
if (lstFiles.SelectedItems.Count != 0)
{
string file = lstFiles.SelectedItems[0].Text;
openFormGeneral(file);
}
}
In WPF .xaml:
<ListView x:Name="lstFile" Height="357" HorizontalAlignment="Left" Margin="18,144,0,0" VerticalAlignment="Top" Width="550"
ItemsSource="{Binding songDetails}"
MouseDoubleClick="lstFile_MouseDoubleClick"
IsSynchronizedWithCurrentItem="True"
SelectedItem="{Binding Path=SelectedSong}">
<ListView.View>
<GridView>
<GridViewColumn CellTemplate="{StaticResource FirstCell}" Width="30" />
<GridViewColumn Header="File Name" DisplayMemberBinding="{Binding FileName}" />
<GridViewColumn Header="Title" DisplayMemberBinding="{Binding Title}" />
<GridViewColumn Header="Artist" DisplayMemberBinding="{Binding Artist}" />
<GridViewColumn Header="Album" DisplayMemberBinding="{Binding Album}" />
<GridViewColumn Header="Set" DisplayMemberBinding="{Binding Set}" />
<GridViewColumn Header="Genre" DisplayMemberBinding="{Binding Genre}" />
<GridViewColumn Header="Language" DisplayMemberBinding="{Binding Language}" />
<GridViewColumn Header="File Path" DisplayMemberBinding="{Binding FilePath}" />
</GridView>
</ListView.View>
</ListView>
I Populate the ListView as follows:
public class songDetails
{
public string Title { get; set; }
public string Artist { get; set; }
public string Track { get; set; }
public string Set { get; set; }
public string Album { get; set; }
public string Genre { get; set; }
public string Language { get; set; }
public string FileName { get; set; }
public string FilePath { get; set; }
}
public IList<songDetails> songDetail { get; set; }
public void AddFile(ID3Info File)
{
lstFile.Items.Add(new
{
FileName = File.FileName,
Artist = File.ID3v2Info.GetTextFrame("TPE1"),
Title = File.ID3v2Info.GetTextFrame("TIT2"),
Track = File.ID3v2Info.GetTextFrame("TRCK"),
Album = File.ID3v2Info.GetTextFrame("TALB"),
Genre = File.ID3v2Info.GetTextFrame("TCON"),
Language = File.ID3v2Info.GetTextFrame("TLAN"),
FilePath = File.FilePath
});
artist = File.ID3v2Info.GetTextFrame("TPE1");
track = File.ID3v2Info.GetTextFrame("TRCK");
set = File.ID3v2Info.GetTextFrame("TPOS");
title = File.ID3v2Info.GetTextFrame("TIT2");
album = File.ID3v2Info.GetTextFrame("TALB");
genre = File.ID3v2Info.GetTextFrame("TCON");
language = File.ID3v2Info.GetTextFrame("TLAN");
InitializeComponent();
this.DataContext = this;
}
How do I access the FilePath from the ListView with MouseDoubleClick event? Thanks in advance
Excellence is doing ordinary things extraordinarily well.
|
|
|
|