|
You can always use the StartupUri on the Application to find this. Here's an example, in C#:
MyControl control =((Window1)Application.Current.StartupUri).MyControl
|
|
|
|
|
Hi,
i was reading this http://www.codeproject.com/KB/WCF/WCFWPFChat.aspx[^]
article, and working with the application and its source code, as well as this one
http://www.ms.phy.hr/wcfchat/[^]
which it is somewhat based on.
I got my client/server to communicate with each other, but only if i run them on the same machine. I just don´t know how to configure the client and server when they are running on different machines in a network or over the internet. Every single example i found so far was about localhost. So I was hoping you could tell me how to set the endpoints(and the bindings) for Network and Internet on Client and server. An Example would be very helpful. Have a lot of thanks
|
|
|
|
|
Hi All, i'm trying to replicate the Windows Media Player style buttons in WPF, however i cant quite get it right, specifically the glow on the bottom. I've searched google and MSDN however i cant find a guide or existing control anywhere.
I can replicate them with a airbrush and colour dodge in photoshop, with a overlay layer for the top gradient. The glow effect in WPF doesnt quite get the right look though. I'm also having a bit of trouble figuring out the orders (the highlight part) without moving a path around when an item is selected. See this image:
http://www.intelligentflight.net/mark/WMP-MenuBar.jpg
taken from WMP and blown up 200%.
The corners on the top are easy enough using a border and just adding a corner radius to the top left/right, the highlight i can do with a rectangle or path and about 60% opacity, however the blue glow at the bottom has me rather confused. Any ideas would be much appreciated.
--
Real programmers don't comment their code. It was hard to write, it should be hard to understand.
|
|
|
|
|
Hi,
some of you might have already seen this:
http://www.youtube.com/watch?v=CufEjqqZ7WU
Does anybody know if and where there's some code around?
Kind regards,
Stevie
Greetings,
Stephan Eberle
hawke@deltacity.org
|
|
|
|
|
That's really neat--but no, I don't sorry.
“Time and space can be a bitch.”
–Gushie, Quantum Leap
{o,o}.oO( Looking for a great RSS reader? Try FeedBeast! )
|)””’) Built with home-grown CodeProject components!
-”-”-
|
|
|
|
|
Just to let you know - I'm most of the way through the auto commenting power toy. It's working pretty neatly right now - although I still haven't figured out the whole commenting attributes bit yet. Boy am I having fun.
The next bit is to work on the auto-uncommenting.
|
|
|
|
|
Awesome! Can't wait to see what you've come up with. It'll sure be nice to comment XAML with some authority!
Pete O'Hanlon wrote: The next bit is to work on the auto-uncommenting.
That would be nice, too.
“Time and space can be a bitch.”
–Gushie, Quantum Leap
{o,o}.oO( Looking for a great RSS reader? Try FeedBeast! )
|)””’) Built with home-grown CodeProject components!
-”-”-
|
|
|
|
|
I'm wishing that I'd done it sooner - it's already proving to be a time saver.
|
|
|
|
|
“Time and space can be a bitch.”
–Gushie, Quantum Leap
{o,o}.oO( Looking for a great RSS reader? Try FeedBeast! )
|)””’) Built with home-grown CodeProject components!
-”-”-
|
|
|
|
|
Well - I've uploaded the source for MoXAMLPowerToys to my blog here[^]. Please feel free to download it and have a look (and be my unofficial beta-tester ). I'd love to know what you think.
|
|
|
|
|
Hey Pete. I'm away from my comp for a couple days, but will definitely check that out when I get home (probably Tuesday)!
Looking forward to trying it out.
Logan
“Time and space can be a bitch.”
–Gushie, Quantum Leap
{o,o}.oO( Looking for a great RSS reader? Try FeedBeast! )
|)””’) Built with home-grown CodeProject components!
-”-”-
|
|
|
|
|
Logan - I've updated the code for MoXAMLPowerToys. I hope you like it - the code is significantly reengineered, and it should be easier for me to add new features now.
|
|
|
|
|
Interesting.
Try searching for augmented reality if you haven't done so already.
|
|
|
|
|
I'm trying to make an RSS reader in WPF. Everything works fine in terms of getting the data, but when the description is loaded, some websites use XML to format the description and add images, etc. to it. What is the best way to convert the XML code that they use and convert it into something that XAML can use?
Thanks.
|
|
|
|
|
Search google for "html to xaml". RSS descriptions would be in html or xhtml, for display on a web page.
This[^] looks promising.
|
|
|
|
|
Can someone show me how to add the
ScrollViewer.VerticalScrollBarVisibility="Visible" as a property to the WPF Listbox properties. I have the code below:
Public Property HorizontalScrollBar() As ScrollViewer
Get
HorizontalScrollBar.VerticalScrollBarVisibility = ScrollBarVisibility.Visible
End Get
Set(ByVal value As New ScrollViewer()
Dim sv As New ScrollViewer()
Me.HorizontalScrollBar = value
End Set
End Property
Thanks
|
|
|
|
|
Your code doesn't make a lot of sense to me, but to add a dependency property to an object, say myListBox, do this:
myListBox.SetValue( ScrollViewer.VerticalScrollBarVisibilityProperty, ScrollBarVisibility.Visible );
I presume that would work, but I don't know for sure.
“Time and space can be a bitch.”
–Gushie, Quantum Leap
{o,o}.oO( Looking for a great RSS reader? Try FeedBeast! )
|)””’) Built with home-grown CodeProject components!
-”-”-
|
|
|
|
|
Hi All,
I've been plodding through msdn (and several websites including this excellent one ) and meddling around for the last few hours to find a solution to the aforementioned issue and was wondering if any kind soul would be willing to offer some assistance
I'm in the middle of writing a simple reporting application. The application should function as follows:
1. A TreeView is populated with a load of XML Tag names
2. The displayed TreeViewItem(s) (the XML tags) are dragged and dropped onto a RichTextBox
3. The items should become ReadOnly so the user doesn't accidentally delete any parts of the tag (thus messing up the report generation), although the user should be able to delete the object entirely by selecting the whole thing
4. The reporting magic happens
I can insert the tags as hyperlinks but it's a naff approach and I'd quite like to have the tags as objects in their own right as it's possible that users might want to insert their own hyperlinks....
Anyone got any ideas? It's been doing my head in for the last few hours...
Cheers,
Drew
|
|
|
|
|
The only way I can think of doing this would be to extend the RTB and insert a custom run, which you would use. You would basically handle the keypresses in your RTB and see if you were inside the run - if you were, you'd suppress the keypresses - if not, you'd let them bubble up.
|
|
|
|
|
Thanks Pete! I'd actually come to the same conclusion and was hoping there was an easier way
Cheers,
Drew
|
|
|
|
|
Just incase anyone hits the same issues as I did, the solution to this problem is quite simple and was solved using an InlineUIContainer and TextBlock (although it took me ages to figure it out) and I've pasted the code snipped below for your reference:
void rtb2_SelectionChanged(object sender, RoutedEventArgs e)
{
Match m = Regex.Match(rtb2.Selection.Text.ToString(), "<.*>");
if(m.Success)
{
string tag = m.ToString();
TextRange tr = new TextRange(rtb2.Selection.Start,rtb2.Selection.End);
System.IO.MemoryStream ms = new System.IO.MemoryStream();
tr.Save(ms, DataFormats.Rtf);
string rtbString = ASCIIEncoding.Default.GetString(ms.ToArray());
System.Text.RegularExpressions.Regex findTags =
new System.Text.RegularExpressions.Regex("<.*>");
rtbString = findTags.Replace(rtbString, "");
System.IO.MemoryStream msOut = new System.IO.MemoryStream();
System.IO.StreamWriter sw = new System.IO.StreamWriter(msOut);
sw.Write(rtbString);
sw.Flush();
msOut.Seek(0, System.IO.SeekOrigin.Begin);
tr.Load(msOut, DataFormats.Rtf);
TextBlock myTextBlock = new TextBlock(new Run(tag));
myTextBlock.Background = Brushes.WhiteSmoke;
TextPointer tp = rtb2.CaretPosition.GetInsertionPosition(LogicalDirection.Forward);
InlineUIContainer myInlineUIContainer = new InlineUIContainer(myTextBlock, tp);
}
And there you have it, my first codeproject solution Hope it proves useful to someone!
Happy coding,
Drew
|
|
|
|
|
Nice one Drew. Well done.
|
|
|
|
|
Super, thanks! This will definitely help me figure out some stuff I've been planning to look at (but putting off).
Always great when someone else can do the figuring out for you.
Cheers.
“Time and space can be a bitch.”
–Gushie, Quantum Leap
{o,o}.oO( Looking for a great RSS reader? Try FeedBeast! )
|)””’) Built with home-grown CodeProject components!
-”-”-
|
|
|
|
|
Can any one Help
I have created one Panel Control(System.Windows.Forms) using wpf window application and create one user control using Windows Control Library.
I want to add the usercontrol in Panel
I have tried the following code
<window x:class="Sivam.Window1" xmlns:x="#unknown"><br />
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"<br />
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"<br />
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"<br />
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"<br />
Title="Sivam" Height="300" Width="300" Loaded="Form_Load"><br />
<br />
grid><br />
windowsformshost margin="7.37,6.72333333333333,48,22"><br />
wf:panel height="50" x:name="panel1" text="Prompt" xmlns:wf="#unknown" /><br />
/windowsformshost><br />
/grid><br />
<br />
/window>;<br />
</window>
private void Form_Load(object Sender, EventArgs e)<br />
{<br />
UserControl1 uc1 = new UserControl1();<br />
panel1.Controls.Add(uc1);<br />
<br />
<br />
}
But I got the Error
Convert System.Windows.Controls to System.Windows.Forms.Controls
Thanks,
Siva
modified on Thursday, September 11, 2008 9:52 AM
|
|
|
|
|
It looks to me like you either have a namespace issue, or you're trying to add the wrong type somewhere. For example, if UserControl1 is a WPF control (which it appears to be), you can't add that to a windows forms panel. Use the Canvas class instead.
The windows forms host is for hosting windows forms controls inside a WPF window.
“Time and space can be a bitch.”
–Gushie, Quantum Leap
{o,o}.oO( Looking for a great RSS reader? Try FeedBeast! )
|)””’) Built with home-grown CodeProject components!
-”-”-
|
|
|
|