|
It might be easier if you use the System.Windows.Controls.WebBrowser control.
See the WebBrowserControlSample in the SDK WPF samples, it shows how to interact with the scripts.
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
I have a WPF Window that at loading time generate a variable number of image with this for cycle :
public Window1()
{
InitializeComponent();
int numPos = 5;
for (int i = 1; i <= numPos; i++)
{
Image imageStatus = new Image();
imageStatus.Name = "Image" + i;
statusGrid.Children.Add(imageStatus);
}
}
Now i need to access at this image from a timer that every 10 seconds change the image.Source Property of every image crested at runtime ..
How Can i do this ?
|
|
|
|
|
i've found a solution , i have an ImageGrid with only Image Created at runtime :
foreach (Image ctrl in imageGrid.Children)
{
if (ctrl.GetType() == typeof(Image))
{
if (((Image)ctrl).Name == "Image1")
((Image)ctrl).Source = new BitmapImage(new Uri("pack://application:,,,/MyApplication/aleroot.png"));
}
}
with this code i change the image source for my Image Created at runtime .
Thanks anyway.
|
|
|
|
|
I started looking into WPF recently for the sake of "research" purposes at work, things got a little slow so I thought I'd check it out to keep busy and the old grey matter churning.
Anyway, since I was playing around, I thought why not get the latest VS2010 RC, things were going OK then BAM, BSOD whilst fiddling with the designer. Thought little of it, and dropped down a step to VS2008 (we currently use VS2005/.NET 2.0), things were going OK for about half a day then all of a sudden the designer was failing to load at all, the markup view was fine as was the C#. When left for about half an hour the whole thing would grind to a halt of a sudden and display an out of memory error in the designer.
It all seemed odd, but it was the end of the day and I left it, came back in today, and out of interest my coworker suggests dragging VS over to the main screen (left) and like a flash, the designer came back to life. Dragged it back over to the right (where I normally like to have VS) and it hung instantly, back to the left and it lives! Unfortunately I did this one too many times and the whole thing BSOD, which then made the VS2010 BSOD make more sense as that's written in WPF.
Anyone run across this problem before? (XP SP3)
Cheers
[EDIT] Now it's happening on the left screen after fiddling with the designer for a couple of seconds, checked my drivers and they're up to date. [/EDIT]
He who makes a beast out of himself gets rid of the pain of being a man.
modified on Thursday, April 8, 2010 7:20 AM
|
|
|
|
|
Ended up just upgrading to Weven at work earlier than planned, seems ok, but obviously not the most ideal solution for everybody
He who makes a beast out of himself gets rid of the pain of being a man.
|
|
|
|
|
Hi,
I have a trreview in place and on selecting a treeviewitem i need to open the appropriate page on the right hand side. Im binding the treeview and its events from database during app load.
My page names are also stored in database and on selecting treeviewitem it should open the page.
Problem:
Page names are in string format. how shuld i typecast it to add it as a children item of the left hand side container
Please provide me with any suggestions or help
Bad Programmer
|
|
|
|
|
Bad Programmer wrote: Page names are in string format. how shuld i typecast it to add it as a children item of the left hand side container
Paste some code here and maybe someone can help you.
Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
First thing to do is make sure that the location you want your pages to be show is a NavigationFrame.
(I think that is the right name for it -- on my home machine not my development machine)
Next thing to do is in the treeview a generic way to provide what to load you want to keep the location/name of the page in the Tag of the control.
Finally when you capture the event Navigate:
HtmlPage.Window.Navigate(new Uri(urlString), targetString);
|
|
|
|
|
I use DrawingContext to do the visual job
I have tried BezierSegment,QuadraticBezierSegment,PolyBezierSegment
but they not worked
they need control points
so the count of the points are confined
and the joined curve was not smoothing
Is there any way in WPF could solve it?
a smoothing curve just like DrawCurve() in Graphic will be ok.
thanks for any answers.
|
|
|
|
|
I have solved it
thanks
if you are interest in this
we could have a conversition
|
|
|
|
|
i'm new in c#.i have a little knowledge of c#.i want to learn wpf.can you tell me whats the proper way to learn wpf?is it possible to start c# with learning wpf first?should i start a project to learn this?if so can you give me some ideas?please tell me the way to start learning wpf.
shoeb
|
|
|
|
|
Start here[^] or here[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi shoeb,
There is probably no proper way to learn anything. It just takes time and effort.
I would start here : Windows Presentation Foundation.
It's well possible to learn C# separately from WPF. The thing in common between them is the .NET framework. You could also choose VB.NET.
Download VS Express, create a WPF forms app and you're in business. From there bootstrap yourself with knowledge gained from books/internet.
Many happy hours toying with .NET,
Sytse
|
|
|
|
|
|
Correct for 5 points, those two books got me in
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
Hi,
How can I set a custom link for downloading silverlight if it'n not installed on clients
Best wishes
|
|
|
|
|
|
I have two project Silverlight and WCF service. When i try to call the WCF service it gives me error
An error occurred while trying to make a request to URI 'http://localhost:1554/DashboardWCFService.svc'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details
can anyone help me in this why i am getting this error.
|
|
|
|
|
|
Hi,
Yes we have placed these file below is the content of these files.
But we still get error
clientaccesspolicy
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<allow-from http-request-headers="*">
<domain uri="*" />
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</cross-domain-access>
</access-policy>
crossdomain
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
|
|
|
|
|
You might want to have a look here.
Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Thanks, article was helpful but our problem was solved by changing the binding from wshttp to basic, which confuses me why it doesnot pick the wshttp binding. does that mean that crossdomain and clienacesspolicy xml files are useless.
|
|
|
|
|
Silverlight 3 does not supoort wshttp binding right now.
Only basicHttp is supported.
Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
modified on Thursday, April 8, 2010 1:44 AM
|
|
|
|
|
I've created a user-control to change border of an item. It is working fine with the following code. When the control is selected, this property appears under 'Miscellaneous' tab in 'Expression Blend/Visual Studio' Properties. But, to write value for this property, I need to type "Thick" / "Thin" etc. in space there. Can I define possible values as "Thick" / "Thin"/ "Thinner"/"None", so that they appear in a 'ComboBox'? Just like it appear in 'Visibility' and others?
I guess, this is something to do with 'TypeConverter'. I am new to C# and WPF. It would be nice, if reply comes with code for this specific problem, instead of generic one.
namespace Counters
{
public partial class TestControl: UserControl
{
private string _borderType = "Thick";
public TestControl()
{
this.InitializeComponent();
}
public static readonly DependencyProperty BorderTypeProperty =
DependencyProperty.Register("BorderType", typeof(string), typeof(TestControl),
new UIPropertyMetadata("Thick", new PropertyChangedCallback(BorderTypeChangedCallBack)));
public string BorderType
{
get { return _borderType; }
set
{
_borderType = value;
if (_borderType=="Thick")
{
}
else if (_borderType=="Thin")
{
}
else if (_borderType=="Thinner")
{
}
else if (_borderType=="None")
{
}
else
{
}
}
}
static void BorderTypeChangedCallBack(DependencyObject property, DependencyPropertyChangedEventArgs args)
{
TestControl textCounter = (TestControl)property;
textCounter.BorderType = (string)args.NewValue;
}
}
}
modified on Wednesday, April 7, 2010 4:27 AM
|
|
|
|
|
Does this help?
<StackPanel>
<ComboBox Margin="5" x:Name="myComboBoxThickness" >
<ComboBoxItem Content="Thick" />
<ComboBoxItem Content="Thin" />
<ComboBoxItem Content="Thinner" />
<ComboBoxItem Content="None" />
</ComboBox>
<Border x:Name="ThisBorder" >
<Border.Style>
<Style>
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=myComboBoxThickness, Path=SelectedItem.Content}" Value="Thick">
<Setter Property="Border.BorderThickness" Value="10"/>
<Setter Property="Border.BorderBrush" Value="Aqua"/>
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=myComboBoxThickness, Path=SelectedItem.Content}" Value="Thin">
<Setter Property="Border.BorderThickness" Value="5"/>
<Setter Property="Border.BorderBrush" Value="Green"/>
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=myComboBoxThickness, Path=SelectedItem.Content}" Value="Thinner">
<Setter Property="Border.BorderThickness" Value="2"/>
<Setter Property="Border.BorderBrush" Value="Yellow"/>
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=myComboBoxThickness, Path=SelectedItem.Content}" Value="None">
<Setter Property="Border.BorderThickness" Value="0"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<TextBlock Text="This is a test arena!!!!!!!!!!!!" />
</Border>
</StackPanel>
|
|
|
|