|
Is it possible to subclass a Window in WPF, so that I can create a base Window class? If so, how?
Everything makes sense in someone's mind
|
|
|
|
|
Hi Kevin,
Create your CustomWindow derived from Window and if you want, you can create the Template for your new Window and assign to it. Let me know if you need more help on it.
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
|
|
|
|
|
I'd like to see an example of that, if you have one.
Everything makes sense in someone's mind
|
|
|
|
|
Hi,
Have a look into this blog post for Silverlight: Creating a Custom Out-Of-Browser Window in Silverlight[^]
There are some good example for WPF too. I will share those links if I recall the URLs from my bookmark.
Till then check for the Silverlight one. You will get the basic understanding from the same.
Let me know, if you have any queries.
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial
|
|
|
|
|
Hi Experts,
I googled a lot to display multi columns on selecting a combobox(i.e datagridcombobox) in WPF datagrid, but couldn't find relevant solution. Pls help.
-Thanks in advance
Kartheesh.
|
|
|
|
|
This may be a trivial question but I'm completely new to Silverlight and right now I just want to know if I can embed a Silverlight control in my "classic" AST.NET (3.5) WebForm page?
Googled for samples but no result.
_____________________________
...and justice for all
|
|
|
|
|
You cannot embed silverlight control individually.
You need to generate .xap file from the silverlight page/control
and then you can easily embed it in aspx page as an object.
Find following code to embed .xap file.
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/SLNetWCF.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="3.0.40624.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
d00_ape wrote: Googled for samples but no result.
You cannot do this and that is why you found no results.
As is posted in the other answer, you can embed your xap control inside the page.
You can probably search for some controls for Asp.net which do something similar to what you are using in Silverlight.
My signature "sucks" today
|
|
|
|
|
Hi,
Is there any way to remove(or hide) the legend from the charting control(PieSeries) and bind the ItemKey instead of ItemValue to display the ItemKey on mouseover .
As I have the following colloection:
ItemKey ItemValue
Delhi - 5
UP - 4
MP - 3
I am binding the following way:
<chartingToolkit:PieSeries <br />
IndependentValueBinding="{Binding ItemKey}" <br />
DependentValueBinding="{Binding ItemValue}"<br />
AnimationSequence="Simultaneous"<br />
IsSelectionEnabled = "true">
Thanks,
Sri
|
|
|
|
|
You need to use style templates as shown here.
My signature "sucks" today
|
|
|
|
|
Is it possible to bind multiple values to a single component in XAML?
I want to put two values into a single TextBlock with one binding attribute. Possible?
.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
|
|
|
|
|
You could do this with the MultiValueConverter available here[^].
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Thanks. I'll look at that at home in the next couple of days (this is for a WPF front-end to my CP article scraping library).
.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
|
|
|
|
|
Ah hah.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
The convert thing won't work for what I need. I just created additional properties that provide the needed data and bound to those instead.
.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,
Did you ever figure this out.
I am trying to do the same thing where if I am binding a property called Score to my WPF data grid, I need the value of it to be reflected when one of the dependency properties changes....
for instance:
Class A : INotifyPropertyChanged
property Score
Class B : INotifyPropertyChanged
property Score (this property value should be dependent on the composition of two ClassA.Score values and should display in the same column that is bound to Score in the Data Grid.
Kindly let me know if you found a solution.
Thanks
|
|
|
|
|
when i am swaping element in grid its refelecting on form but at time of saving when i ll go for reading it will not give me updated one .
for swaping i am using Grid.SetRow and Grid.SetColumn function.
Border borderInnerAttr;
Grid.SetRow(borderInnerAttr, Grid.GetRow(borderInnerAttr) - 1);
Grid.SetColumn(borderInnerAttr, Grid.GetColumn(borderInnerAttr));
here i am able to swap element in grid but at the time reading grid it will return me the original position of elements.
Pls help me ....
Reasons are not Important but Results are Important.
http://www.sql4professional.blogspot.com
Swati Tripathi
modified on Thursday, May 27, 2010 8:54 AM
|
|
|
|
|
This should be easy but I can't get to work. I just want to set the value of a textbox when the select value in a list box changes.
Here's how it works in a combobox.
Category.Text = ComboBox1.Text
How does it work in a list box in vb.2010 (WPF)?
|
|
|
|
|
Have a look here.
The equivalent of Category.Text = ComboBox1.Text is a little different in WPF.
You need to link the CurrentItem of a listbox to your textbox.
The link above might give you a better idea.
My signature "sucks" today
|
|
|
|
|
Thats good info, but I really do not want to databind that textbox. I'm binding back to SQl already I just want to give the user an easy way to populate/change the field value. The combo works, but a list box looks much better. I'm making it visilble from a click event.
Thanhks for the info.
|
|
|
|
|
Hi,
you must convert the SelectedItem of the ListBox into the string you need. You can do this by binding it to another property (of your viewmodel) and in the new property's setter, you can transfer the converted string-value to your TextBox.Text-property. Alternatively you must code the SelectionChanged -event of the ListBox.
The type of the SelectedItem depends on the given Items (sounds a bit stupid, I know). If you fill the ListBox at designtime, you will probably have something like
<ListBox ... >
<ListBox.Items>
<ListBoxItem Content="one" />
<ListBoxItem Content="two" />
<ListBoxItem Content="three" />
</ListBox.Items>
</ListBox>
In this case, the SelectedItem is of type ListBoxItem . If you e. g. provide a List<string> as ItemsSource , you get a string as SelectedItem.
As mentioned by Abhinav S you might want to consider using the IsSynchronizedWithCurrentItem property.
Cheers
Jürgen
|
|
|
|
|
Hi All,
Hope you all are good.
I am adding some wrap panels to a list box..
my coding is
for (int i = 0; i < 15; i++)
{
WrapPanel wrp = new WrapPanel();
wrp.Name = "wrp" + i.ToString().Trim();
Label lbl1 = new Label();
lbl1.Content = "Code " + i.ToString().Trim();
Label lbl2 = new Label();
lbl2.Content = "Desc " + i.ToString().Trim();
wrp.Children.Add(lbl1);
wrp.Children.Add(lbl2);
lbOne.Items.Add(wrp); //lbone is source list box
}
so now i have 15 wrap panels in my lisbox.
i need to add the selected items(wrappanel) to other list box (may be destination)
i tried using
lbtwo.items.add(lbone.selecteditem);
but it says that it has some logical parent.
i.e it is already in the first list box lbone and it cannot be added to the new one..
may i know is there solution for this?
can we add liek this?
|
|
|
|
|
There is, and it's a bit gnarly. The good Dr WPF came up with a Conceptual Children article which details how to solve this issue here[^].
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Whoa ... need to ingest that one at some point ...
|
|
|
|
|
Hi experts,
Created one method to export the datagridview data to excel in winforms which is working fine. Now in similar way i wanted to export data from WPF datagrid to excel, i googled it lot but couldn't find relevant solution.
Any help would be appreciated.
Thanks in advance
-Kartheesh
|
|
|
|