-
Feb 18th, 2009, 01:35 PM
#1
Thread Starter
Frenzied Member
Highlight Your Xaml - Heres How!
As some of you may know, I have been working on a Xaml highlighting engine that produces BB-Code for vBulletin based forums. The ALPHA version was tested by VBNeo, Chris128 and I extensively before moving to BETA. The engine has now been moved to BETA and is available to download here.
Mendhak has kindly offered to create a webfront and host the x:Light engine which means you now have no excuse not to highlight your Xaml before posting it to the board. Please be aware that both the webfront and the engine are WIP(works in progress) so feel free to PM me if any bugs arise.
X:Light Web Link
-
Feb 18th, 2009, 07:32 PM
#2
Re: Highlight Your Xaml - Heres How!
Cool the web front end is a good idea.
Gotta give it a test :P
Code:
<Window x:Class="Loginfrm"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Service Desk Logger - Version 1.0.0" Height="208" Width="362" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Name="Loginfrm" ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen" WindowStyle="None" Background="Transparent" AllowsTransparency="True">
<Border BorderBrush="Black" BorderThickness="0.8" CornerRadius="8,8,0,0">
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FF37506B" Offset="0"/>
<GradientStop Color="#FF132238" Offset="1"/>
</LinearGradientBrush>
All good.
-
Feb 19th, 2009, 10:01 AM
#3
Re: Highlight Your Xaml - Heres How!
I think another method to convert it to HTML (so that people can use it in blogs) would be a good future project.
I've been trying it out a lot and sometimes I get single-line, sometimes multi line. I copied what chris had in his post.
Code:
<Window x:Class="Loginfrm" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Service Desk Logger - Version 1.0.0" Height="208" Width="362" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Name="Loginfrm" ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen" WindowStyle="None" Background="Transparent" AllowsTransparency="True"> <Border BorderBrush="Black" BorderThickness="0.8" CornerRadius="8,8,0,0"> <Border.Background> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FF37506B" Offset="0"/> <GradientStop Color="#FF132238" Offset="1"/> </LinearGradientBrush>
Last edited by mendhak; Feb 19th, 2009 at 10:05 AM.
-
Feb 19th, 2009, 10:59 AM
#4
Thread Starter
Frenzied Member
Re: Highlight Your Xaml - Heres How!
Im working on plans to include a HTML engine but because html is structured the same as xaml the current engine will not do as it will try to highlight the highlight code. Im trying to come up with a way of building one string from another but it is proving harder than I tought.
Regarding the linebreak issue. That only happens when you copy from the forums it has something to do with the linebreak they use. any suggestions?
-
Feb 19th, 2009, 11:02 AM
#5
Re: Highlight Your Xaml - Heres How!
Yeah that happens when you copy and paste any code that has the "vb" or "vb.net" highlight tag too. Its a right pain in the ass when you want to copy and paste a big chunk of code into VS, as you have to go through and enter each line break in manually.
-
Feb 19th, 2009, 10:33 PM
#6
Thread Starter
Frenzied Member
Re: Highlight Your Xaml - Heres How!
I wonder what the code box uses as its newline.
-
Feb 20th, 2009, 02:22 AM
#7
Re: Highlight Your Xaml - Heres How!
Originally Posted by DeanMc
Im working on plans to include a HTML engine but because html is structured the same as xaml the current engine will not do as it will try to highlight the highlight code. Im trying to come up with a way of building one string from another but it is proving harder than I tought.
Regarding the linebreak issue. That only happens when you copy from the forums it has something to do with the linebreak they use. any suggestions?
Debugging... set a breakpoint on the string received. Check to see if you're getting \r\n or just \n or just \r. I'm sure that xLight.dll isn't modifying any newlines but it's possible that it isn't working the other way around. The problem happens the moment you copy from that code box, so maybe you need to look for 'half-line-breaks' and replace them? That of course depends on what is in there.
-
Feb 20th, 2009, 03:06 AM
#8
Re: Highlight Your Xaml - Heres How!
Hey,
I haven't really played with the XAML side of things yet, but I take it this is done within Visual Studio?!? If so, can you not use this Visual Studio Addin:
http://www.jtleigh.com/people/colin/...ySourceAsHtml/
I use it all the time for extracting code from Visual Studio for the purposes of posting into Blogs etc.
Just a thought.
Gary
-
Feb 20th, 2009, 07:49 AM
#9
Thread Starter
Frenzied Member
Re: Highlight Your Xaml - Heres How!
You could do that but then A: it wouldn't be on the web, B: you may not be writing in VS and most importantly C: I wouldn't learn anything new.
-
Feb 20th, 2009, 08:07 AM
#10
Re: Highlight Your Xaml - Heres How!
Originally Posted by chris128
Yeah that happens when you copy and paste any code that has the "vb" or "vb.net" highlight tag too. Its a right pain in the ass when you want to copy and paste a big chunk of code into VS, as you have to go through and enter each line break in manually.
What browser are you using?
I have found that this happens if you are using FireFox 3.0.6, but if I use Internet Explorer 7 or Chrome, this doesn't happen.
Gary
-
Feb 20th, 2009, 08:10 AM
#11
Re: Highlight Your Xaml - Heres How!
Originally Posted by DeanMc
You could do that but then A: it wouldn't be on the web, B: you may not be writing in VS and most importantly C: I wouldn't learn anything new.
Dean, I didn't mean any offence, I was just suggesting that CSAH could be used to get the HTML equivalent of the XAML markup. If nothing else, you can look at how it achieved it as the Source Code is available.
Gary
-
Feb 20th, 2009, 08:43 AM
#12
Re: Highlight Your Xaml - Heres How!
I'm using IE 7 and sometimes Opera 10 and it seems to happen in both as far as I can recall
-
Feb 20th, 2009, 08:45 AM
#13
Re: Highlight Your Xaml - Heres How!
Strange...
Anyways, as a work around, you might want to try the following:
http://www.vbforums.com/showthread.php?t=543154
Gary
-
Feb 20th, 2009, 08:56 AM
#14
Thread Starter
Frenzied Member
Re: Highlight Your Xaml - Heres How!
I know ya didn't dont panic. It takes a lot to get me offended.
-
Feb 20th, 2009, 08:57 AM
#15
Thread Starter
Frenzied Member
Re: Highlight Your Xaml - Heres How!
Originally Posted by mendhak
Debugging... set a breakpoint on the string received. Check to see if you're getting \r\n or just \n or just \r. I'm sure that xLight.dll isn't modifying any newlines but it's possible that it isn't working the other way around. The problem happens the moment you copy from that code box, so maybe you need to look for 'half-line-breaks' and replace them? That of course depends on what is in there.
Quite right it just assumes they are there. I will look into this one today so!.
-
May 27th, 2009, 07:25 AM
#16
Re: Highlight Your Xaml - Heres How!
bump because this is useful and more people should see it (I used it just 5 minutes ago! )
-
May 27th, 2009, 12:58 PM
#17
Thread Starter
Frenzied Member
Re: Highlight Your Xaml - Heres How!
I'll ask Mendhak for a sticky!
-
May 27th, 2009, 01:07 PM
#18
Re: Highlight Your Xaml - Heres How!
good idea maybe it could replace the one thats currently up there that just asks people to be patient as we dont know everything about WPF (if they arent keen on having any more stickies I mean)
-
May 27th, 2009, 01:11 PM
#19
Thread Starter
Frenzied Member
Re: Highlight Your Xaml - Heres How!
I've pm'ed a list that should clean it up a bit
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|