|
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>
|
|
|
|
|
Thanks for your reply. But here I need something related to user-control. 'BorderType' is a custom made property of that control. And this property appears in 'properties' panel along with other properties(e.g. Opacity/Visibility etc), when one selects that user-control.
Everything is fine with current code. But, I need to type the value of 'BorderType' in 'Properties' panel. I am looking for a way, where I can choose the value from combo-box.
|
|
|
|
|
Oh OK, I did something similar with a control for visibility of the Toolbar. It would be the very similar.
You need to set yourself up a public Enum for your types of Border
public enum BorderTypes
{
Thick = 0,
Thin = 1,
Thinner = 2,
None= 3,
}
Now I think this should work for you (fingers crossed)
#region BorderThicknessProperty DP
public static readonly DependencyProperty myBorderThicknessProperty =
DependencyProperty.Register("myBorderThickness", typeof(BorderTypes), typeof(TestControl),
new FrameworkPropertyMetadata(BorderTypes.Thick, new PropertyChangedCallback(OnBorderThicknessPropertyChanged)));
public BorderTypes myBorderThickness
{
get { return (BorderTypes)GetValue(myBorderThicknessProperty); }
set { SetValue(myBorderThicknessProperty, value); }
}
private static void OnBorderThicknessPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
BorderTypes ds = (BorderTypes)e.NewValue;
switch (ds)
{
case BorderTypes.Thick :
{
((TestControl)d).<Name of your control here to set the border thickness on>.BorderThickness = 10;
}
break;
}
}
#endregion
modified on Thursday, April 8, 2010 4:16 AM
|
|
|
|
|
Perfect! This works. Many thanks...
|
|
|
|
|
Even though my UserControl is larger than the screen, the browser doesn't give me any scrollbars. Why not?
Solution ==========
You have to put a ScrollViewer around the main Grid component.
.45 ACP - because shooting twice is just silly ----- "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 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Hi
I am trying to change the look of the ComboBox when it is disabled. I want to change it's background and border. I tried the most common aproach with triggers but that did not work. Than I tried changing the template but could not find the part that should be changed. Does anybody has a solution for my problem?
Any advice will be appreciated.
Uros
|
|
|
|
|
Try this:-
<pre>
<Style x:Key="DisabledComboBoxStyle" TargetType="ComboBox">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Template" >
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="20" />
</Grid.ColumnDefinitions>
<Border
Grid.ColumnSpan="2"
CornerRadius="2"
Background="Red"
BorderBrush="Green"/>
<Border
Grid.Column="0"
CornerRadius="2,0,0,2"
Margin="1"
Background="Yellow"
BorderBrush="Black"
/>
<Path
Grid.Column="1"
Fill="Aqua"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M 0 0 L 4 4 L 8 0 Z"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</pre>
In XAML:-
<pre>
<ComboBox Name="cbBox" Style="{StaticResource DisabledComboBoxStyle}" Height="35" IsEnabled="False" />
</pre>
hth,
v
|
|
|
|
|
Thanks for your reply - it works great. Maybe just one more thing. ComboBox with this style doesn't show the selected item(text) when disabled. I tried adding a TextBlock to one of the border's but I don't know to what should be bind to. Any ideas?
Thanks again for your help.
Uros
|
|
|
|
|
I have a button style resource defined (essentially, it defines the button's shape to be an ellipse instead of a rectangle). I am programatically adding a button with this style to my user control. There is no text/content on the button. This part works just fine.
When I add this button, I want to change the background color (green, yellow, red, or gray) based on a given status. How would I go about doing that?
EDIT =========
I kinda cheated. Instead of having just one style and changing the color inside it, I created foru button styles that represent the four status indicators, and pick the appropriate style in the code.
I know, it's probably not very "silverlighty", but it got me past the issue.
Still, if anyone wants to comment, be my guest.
.45 ACP - because shooting twice is just silly ----- "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 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|