|
Can you open your icon with some other program on XP? If not, you'll have to change it so that it can be opened there (it's best to create it on an XP machine).
|
|
|
|
|
It is a .ico file - I think these are incompatible with Windows XP but that's just a guess. I'm just going to create a separate library of images with a different file type and see what the outcome is.
|
|
|
|
|
How does Wcf Ria Services connect Access Database?
|
|
|
|
|
I've been trying to code my first MVVM app, and I'm not sure I've got things right! I'm using
Packt Pub's WPF Cookbook 4.5 [^] as a main ref.
I have a 3 main objects, Suite, which contain 1 or more Jobs, which contain 1 or more Dependancies, and finally there's a 4th Suite Collection.
At the moment each of these are inheriting from ObservableObject (that basically just helps if INPC). And Suite contains an ObservableCollection<<Job>> , Jobs an ObservableCollection<<Dependancy>> .
Is this right? Should the model contain the INPC stuff?
My ViewModels inherits from ViewModelBase , which also inherits ObservableObject . ViewModelBase takes a generic Model parameter. Which when creating the ViewModel is set to one of the model classes above.
In the ViewModel I've got properties like this that wrap the underlying model's property:
public string Suite
{
get { return Model.Name; }
set { Model.Name = value; }
}
But I've implemented the collections as:
public IEnumerable<JobVM> Jobs
{
get { return Model.Jobs.Select(f => new JobVM(f, this) { Model = f }); }
}
I understand why the conversion to a VM is needed, but I'm not quite sure how it works when I want to add Jobs, but it seems too.
So I've been building things up, but adding/removing and editing items in the collections doesn't seem to be as smooth/easy as it should be, so I'm questioning if I've got the bottom bits right before I keep hacking away!?!
If what I've got is about right, then I'll have some more q's!
|
|
|
|
|
Everything that you bind to needs to implement INPC / INCC at some level.
So ObservableCollection<x> already implements INCC for you, but x needs to implement INPC. If you have a nested ObservableCollection<y>, that ObservableCollection will handle the INCC notifications for that collection, but y needs to implement INPC and so on.
|
|
|
|
|
That makes sense, but would you put the INPC/INCC at the model level or the ViewModel level?
From my beginners pov I can see ways of doing it either way, and questioning what I'm missing!
|
|
|
|
|
As I noted in my previous response, *EVERYTHING* that you will be binding to needs to implement INPC/INCC. That includes views, view models, models, controls, etc. Personally, I never use code behind in my views, so that's not an issue. All the other ones, you need to implement INPC/INCC at every level.
|
|
|
|
|
Hi..Can someone help me to run a silverlight(3)application on linux.I had tried to run silverlight 3 project with the help of Moonlight plug in on linux but I was not succeed ....
Please help me..!!!!!!!!!
|
|
|
|
|
How do you expect someone on a forum to help you with what is probably a setup or installation issue...
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: How do you expect someone on a forum to help you with what is probably a setup or installation issue...
second your thought, however your tone looks kinda rude. Apologies if its hurt
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
ThatsAlok wrote: however your tone looks kinda rude
I was being polite, I did not call the OP a bloody idiot, which the question deserved.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: I did not call the OP a bloody idiot, which the question deserved.
i am not 1voter, however will even it out
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I recommend that the next time yhou think that a poster is "a bloody idiot", you simply ignore the question and make no attempt whatsoever to answer it.
You might consider that strategy even when your judgement is somewhat less harsh than "bloody idiot". Actually, if you are not able to help the poster with his problem, in a way that the poster will experience as helpful, you don't need to post a reply, regardless of how you judge the poster's abilities.
There are far more stupid answers than stupid questions in this world.
|
|
|
|
|
Oh dear have I offended your sensibilities, tough. For a start I did not call the OP a bloody idiot as he deserved, I discussed the quality of his question with ThatsAlok.
The original question was dumb, which I happily implied. I also pointed him to the most probable areas causing the unspecified problem.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
This may sound a bit Armature but here it is.
What is the Form_load equivalent for a C#-Silverlight.
I have to Add shapes based on the available data.
1. I tried Putting the code in the MainPage() that does not work as the canvas actual height is NAN.
2. UserControl_Load() doesn't Work too.
I have to add any number of shapes so I can't add add them on design time.
Please Help
Thanks
|
|
|
|
|
|
It's the "Loaded" event.
void MyUserControl_Loaded(object sender, RoutedEventArgs e)
{
}
To set up the event handler, you can use
this.Loaded += MyUserControl_Loaded in code behind, or
Loaded="MyUserControl_Loaded" in XAML
|
|
|
|
|
I'm using the WPF Extended Toolkit PropertyGrid (v1.7), and I'm trying to setup a custom editor to display a dialog box when the user clicks a button. My problem is that I can't get the property grid to display the editor panel at all.
I tried doing it this way, but it wouldn't display, and after some investigation in the debugger, I noticed that the template's VisualTree was null:
public class CDSceneSelectorEditor : DialogPropertyValueEditor
{
public CDSceneSelectorEditor()
{
string template =
@"<DataTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
// xmlns:pe='clr-namespace:System.Activities.Presentation.PropertyEditing;assembly=System.Activities.Presentation'>
<DockPanel LastChildFill='True'>
<pe:EditModeSwitchButton TargetEditMode='Dialog' Name='EditButton'
DockPanel.Dock='Right' Content='...' />
<TextBlock Text='Picture' Margin='2,0,0,0'
VerticalAlignment='Center'/>
</DockPanel>
</DataTemplate>";
try
{
using (var sr = new MemoryStream(Encoding.UTF8.GetBytes(template)))
{
this.InlineEditorTemplate = (DataTemplate)(XamlReader.Load(sr));
}
}
catch (Exception ex)
{
if (ex != null) {}
}
}
}
So, I figured that the visual tree must be the issue, so I tried it this way, which gave me a VistalTree , but didn't change the outcome:
public class CDSceneSelectorEditor : DialogPropertyValueEditor
{
public CDSceneSelectorEditor()
{
var button = new FrameworkElementFactory(typeof(EditModeSwitchButton))
{ Name = "EditButton" };
button.SetValue(DockPanel.DockProperty, Dock.Right);
button.SetValue(EditModeSwitchButton.TargetEditModeProperty,
PropertyContainerEditMode.Dialog);
button.SetValue(EditModeSwitchButton.ContentProperty, " ... ");
button.SetValue(TextBlock.MarginProperty, new Thickness(0,0,3,0));
var image = new FrameworkElementFactory(typeof(Image))
{ Name = "ThumbnailImage" };
image.SetValue(Image.StretchProperty,
System.Windows.Media.Stretch.Uniform);
var panel = new FrameworkElementFactory(typeof(DockPanel));
panel.AppendChild(button);
panel.AppendChild(image);
DataTemplate template = new DataTemplate();
template.VisualTree = panel;
this.InlineEditorTemplate = template;
}
}
I am out of ideas, and google has been no help at all.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Hi,
0 down vote favorite
I am learning to draw a line graph inside my WPF. i found a tutorial of a horizontal line graph at this side: http://www.c-sharpcorner.com/uploadfile/mahesh/line-chart-in-wpf/ and i manage to plot it. But my question is how to draw a vertical graph?
I taking the example of the graph from the website i provided, if transform the graph to the vertical graph. The X-axis will be the int(on the top) and the Y-axis will be the Date(at the left hand side). Anyone can help me out?
The graph i want should be like this: http://imageshack.us/photo/my-images/202/capturegfj.jpg/
Thanks.
|
|
|
|
|
I have this data:
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfFolderEntity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<FolderEntity Id="0" FolderName="Projects" Description="">
<Folders>
<FolderEntity Id="3" FolderName="Folder 1" Description="Folder 1 Desc ">
<Folders />
<Files>
<FileEntity Id="1" FileName="File A" Description="File A Desc " />
<FileEntity Id="2" FileName="File B" Description="File B Desc " />
</Files>
</FolderEntity>
<FolderEntity Id="6" FolderName="Folder 2" Description="Folder 2 Desc ">
<Folders />
<Files>
<FileEntity Id="4" FileName="File C" Description="File C Desc " />
<FileEntity Id="2" FileName="File B" Description="File B Desc " />
</Files>
</FolderEntity>
</Folders>
<Files />
</FolderEntity>
</ArrayOfFolderEntity>
and after it's deserialized it populated a list if Folders and Files:
Then in the view I have TreeView:
<TreeView x:Name="tvwItems"
BorderThickness="0"
Background="Transparent"
Grid.Row="1"
Grid.Column="0"
Margin="0,2,0,2"
ItemsSource="{Binding Folders}">
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type entities:FolderEntity}"
ItemsSource="{Binding Folders}">
<TextBlock Text="{Binding Path=FolderName}" />
</HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type entities:FileEntity}" >
<TextBlock Text="{Binding Path=FileName}" />
</DataTemplate>
</TreeView.Resources>
</TreeView>
The data is being loaded correctly, but when It runs all I see is
Projects
Folder 1
Folder 2
... no files.
What am I doing wrong?
If it's not broken, fix it until it is
|
|
|
|
|
I always create a child collection eg folder object has an observablecollection of Files. Bind the tree to Folders and your Hierarchical template should bind to the child items (Files).
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
To add to Mycroft's answer, you need to call the collection of files property "Children". Then the tree will simply populate itself when you bind the tree to the folders collection.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Not sure I understand. You're saying by simply calling it 'Children', it will update itself??
If it's not broken, fix it until it is
|
|
|
|
|
Yes, it should.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
Ok, I see. Thanks
If it's not broken, fix it until it is
|
|
|
|