|
Hi,
I have 3 controls using in a wpf window..textbox, listbox and listview.
The textbox is like a searching textbox, where i search for Folder's in a particular folder, the list of searched folders will be displayed in listbox. I am able to do until this part.
Now, if I select any of the displayed folders in the listbox, then the files available in the particular folder should be displayed in the ListView. (missing out the link b/w the 2 here).
eg : I have 3 folders displayed in listbox (say folder1, folder2, folder3).each folder has few excel files. I selected folder 2 ( which has 5 excel files, mark.xls, steve.xls, cary.xls, rick.xls and jenny.xls and also a subfolder inside that called Launch1).
Now, the List view should show the folder2 contents divided into 3 columns, ( col1, col2, col3).
Name Desc Date
-------------------------------------------------------------------------------------------------------------
Mark this is mark's excel 07/20/2009
steve this is steve's excel. 07/22/2009
cary ............ ..................
rick .................... ........................
jenny .................... ...........................
------------------------------------------------------------------------------------
+ Launch1
Again Launch1 folder might have few workbooks, so I have put a plus on it.. so when + is clicked.. it shuold display the files inside this folder.
I am using Xaml and C#... please help.
Thank You,
Ramm
|
|
|
|
|
Which bit are you stuck on ? What have you already written ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I am following Sergey Zwezdin's blog "Windows 7 programming: Taskbar. Part 5 – CustomWindowsManager[^]" for creating the CustomWindowManager object.
As much as I gone thru the code, I realised that, I can create a custom preview window for the Windows 7 taskbar for the Window using it's handle. I want to do the same thing for the UserControl. How can I achieve this, as this only takes parameter of Windows & Windows handle.
My problem is: on click of a button I will create an object of an UserControl & then I will display it on the screen as a MwiChildWindow (Just like MDI form). I am able to create the MwiWindow & it's children but unable to show the child in the Taskbar previews. If I have four child windows (UserControls) visible in the main Window... I am getting only one preview of the Window.
I want to create 5 previews (1 MainWindow & 4 opened Child Window) to be visible in the pane.
Can anyone please guide me to resolve the same as early as possible? I didn't find anything on the net.
I am using Visual Studio 2008 SP1 (WPF 3.5 SP1) with Windows7APICodePack.
Looking forward... Thanks in advance.
Regards,
- Kunal Chowdhury ( My Blog)
|
|
|
|
|
After doing lots of analysis I got the solution. I am sharing the same for the benefit of others:
First we have to register the two events:
Taskbar.TabbedThumbnail.TabbedThumbnailActivated += new EventHandler<TabbedThumbnailEventArgs>(TabbedThumbnail_TabbedThumbnailActivated);
Taskbar.TabbedThumbnail.TabbedThumbnailClosed += new EventHandler<TabbedThumbnailEventArgs>(TabbedThumbnail_TabbedThumbnailClosed);
Then do the implementation of the registered events:
void TabbedThumbnail_TabbedThumbnailClosed(object sender, TabbedThumbnailEventArgs e)
{
}
void TabbedThumbnail_TabbedThumbnailActivated(object sender, TabbedThumbnailEventArgs e)
{
}
Now ehen you want to add the usercontrol... do the following steps:
TabbedThumbnailPreview thumnailPreview = new TabbedThumbnailPreview(this, myUserControl);
thumnailPreview.Title = "My UserControl Title";
thumnailPreview.InvalidatePreview();
Taskbar.TabbedThumbnail.AddThumbnailPreview(thumnailPreview);
That's it...
Regards,
- Kunal Chowdhury ( My Blog)
|
|
|
|
|
Whenever an item is selected in the listview I am wanting to basically just get the value of the first selected item in the first column.
It seems it is not done the same way in C# as with C# WPF. Could you provide me with somewhere I can learn how to do this?
|
|
|
|
|
I created an Expression MediaPlayer app with Encoder 2 using the SL2Gallery template. The app works perfectly stand-alone but I want to put the player on a page in another Silverlight 2 app. The playlist for the original app is supplied to the .xap through initParams. I copied the entire Page.xaml into my page (changed the namspace etc) and added the playlist to the player as follows. It almost works. I have three problems.
1. The playlist listbox acts as though the scroll area is only two items long. It's plenty big to show all of the items. Sometimes when scrolling a third item will show up, but it's intermittent.
2. The Thumbs don't display. I've tried every conceivable Build Action, but nothing seems to work. And yes I can see them added to the compilation during the build.
3. If the first two can be solved, I'd like it to auto start when the page opens.
<ExpressionPlayer:ExpressionPlayer Margin="0,0,0,0"
x:Name="myPlayer"
Style="{StaticResource GalleryTemplate}">
<ExpressionPlayer:ExpressionPlayer.Playlist>
<ExpressionMediaPlayer:PlaylistItem Title="Preparing Your Home"
MediaUrl="Properties/video1.wmv"
Description="My Description"
ThumbSource= "Properties/video1_Thumb.jpg"
FrameRate="25" />
<ExpressionMediaPlayer:PlaylistItem Title="2"
MediaUrl="Properties/video2.wmv"
ThumbSource="Properties/video2_Thumb.jpg"
FrameRate="25" />
<ExpressionMediaPlayer:PlaylistItem Title="3"
MediaUrl="Properties/video3.wmv"
ThumbSource="Properties/video3_Thumb.jpg"
FrameRate="25" />
<ExpressionMediaPlayer:PlaylistItem Title="4"
MediaUrl="Properties/video4.wmv"
ThumbSource="Properties/video4_Thumb.jpg"
FrameRate="25" />
</ExpressionPlayer:ExpressionPlayer.Playlist>
</ExpressionPlayer:ExpressionPlayer>
There is very little information on how to use the SL2Gallery template, so if someone could assist I'd appreciate it.
Thanks,
Steve
|
|
|
|
|
Hi Steve,
If you can send the sample project that you are having problems then I will try to see what I can help you.. The code that you pasted here seems fine to me.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Microsoft MVP (Silverlight), WPF/Silverlight Insiders
|
|
|
|
|
Michael,
I created a small app that just included the MediaPlayer in Blend 2 and it worked fine. As soon as I opened it in VS it transformed the project into a SL3 project and it stopped working. I guess I wasn't paying attention the first time. In an attempt to get everything into SL3 I downloaded Encoder 3 (I already have Blend 3), however now apparently Playlist doesn't contain PlaylistItems. At this point I'm totally confused. Plus, our neighbors are having a tree taken down and the noise is driving me crazy!!! I'm going to hang it up for the day and start fresh tomorrow.
Thanks for your offer of help and if I find anything tomorrow I'll post it,
Steve
|
|
|
|
|
Sorry to hear about those behavior in Silverlight 3 and Encoder. Feel free to let me know if you are having the same problem even you start fresh
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
Microsoft MVP (Silverlight), WPF/Silverlight Insiders
|
|
|
|
|
Sorry I didn't get back on this; I got busy with other things. I worked it out by modifying the template code. Now it works beautifully!
Thanks for the help,
Steve
|
|
|
|
|
Give me some help please!
|
|
|
|
|
hi error,
There are plenty much commercial solutions out there. Try Google with 'WPF Reporting'.
If you want to keep things simpler and are not afraid of writing a little bit code, you could do the job with WPF's FlowDocument.
Just bind the corresponding fields to TextBlock / TextBox items in the Document and voila ...
First step : Create a FlowDocument with it's content and placeholders.
( This is maybe a very poor example, but it should give you a kick into the right direction )
<FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
ColumnWidth="400" FontSize="14" FontFamily="Georgia">
<Paragraph>
<!-- Header-->
<TextBlock Text="Header of the Report ...." />
<!-- Binding of Fields -->
<TextBlock Text="{Binding Path=DesiredFieldName}" />
<!-- Footer -->
<TextBlock Text="Footer of the Report ...." />
</Paragraph>
</FlowDocument>
Step two : Instanciate your FlowDocument ( in this case from within C# code )
string xaml = null;
StreamResourceInfo sri = Application.GetResourceStream(new Uri(@"..\Documents\Report.xaml", UriKind.Relative));
using (StreamReader reader = new StreamReader(sri.Stream))
{
xaml = reader.ReadToEnd();
}
FlowDocument myReport = (FlowDocument)XamlReader.Parse(xaml);
Step three : Bind the source to your FlowDocument ( Report ), so it's 'fields get filled' by binding.
For example with the EntityFramework as dataprovider. ( Again this is just an example ! You could do this with nearly every datasource )
using(Entities ctx = new Entities())
{
myReport.DataContext = from c in ctx.articles select c.price;
}
And finally : If you want to show your generated report, you could do so showing it in an FlowDocumentReader.
<FlowDocumentReader Name="myReportViewer" />
And now set our generated report to the Document property of the FlowDocumentReader ...
myReportViewer.Document = myReport;
Let me know if that helped you.
Cheers Doc.NET.Noodles
(PS.: Dont forget to vote if that answer helped you. )
|
|
|
|
|
Just use SQL Reporting Services - there's no need to use a pure WPF solution 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
|
|
|
|
|
This is very basic BackgroundWorker Example but I dont know why the progress bar run 2 times. It should run only 1 time. anyone can help me.
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Text
Imports System.Threading
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Documents
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Imaging
Imports System.Windows.Shapes
Namespace WindowsApplication1
Partial Public Class Window1
Inherits System.Windows.Window
Private WithEvents _worker As BackgroundWorker
Public Sub New()
InitializeComponent()
End Sub
Private Sub StartWorker(ByVal sender As Object, ByVal e As RoutedEventArgs)
End Sub
Private Sub button1_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
_worker = New BackgroundWorker()
_worker.WorkerReportsProgress = True
_worker.WorkerSupportsCancellation = True
AddHandler _worker.DoWork, AddressOf DoWorkEventHandler
AddHandler _worker.ProgressChanged, AddressOf ProgressChangedEventHandler
AddHandler _worker.RunWorkerCompleted, AddressOf RunWorkerCompletedEventHandler
_worker.RunWorkerAsync()
_btnStart.IsEnabled = False
_btnCancel.IsEnabled = True
End Sub
Private Sub DoWorkEventHandler(ByVal s As Object, ByVal args As DoWorkEventArgs) Handles _worker.DoWork
Dim worker As BackgroundWorker = TryCast(s, BackgroundWorker)
For i As Integer = 0 To 4
If worker.CancellationPending Then
args.Cancel = True
Return
End If
Thread.Sleep(100)
worker.ReportProgress(i + 1)
Next i
End Sub
Private Sub ProgressChangedEventHandler(ByVal s As Object, ByVal args As ProgressChangedEventArgs) Handles _worker.ProgressChanged
_progressBar.Value = args.ProgressPercentage
End Sub
Private Sub RunWorkerCompletedEventHandler(ByVal s As Object, ByVal args As RunWorkerCompletedEventArgs) Handles _worker.RunWorkerCompleted
_btnStart.IsEnabled = True
_btnCancel.IsEnabled = False
_progressBar.Value = 0
End Sub
Private Sub CancelWorker(ByVal sender As Object, ByVal e As RoutedEventArgs)
_worker.CancelAsync()
End Sub
End Class
End Namespace
|
|
|
|
|
Member 3068741 wrote: I dont know why the progress bar run 2 times. It should run only 1 time.
I don't see anything that runs twice in there.
Use your debugger - use breakpoint(s). Is button1_Click called more than once?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
hi,how should i use wpf draw staff gauge ?
there's lot of controls, which one is siutable for this condition?
every suggestion will be helpful, thanks a lot!
ICQ:126406887
|
|
|
|
|
it seems like this
0_1_2_3_4_5_6_7_8_9_10_11_12_13_14_15_16_
ICQ:126406887
|
|
|
|
|
Hi,
Just started with my first WPF web browser application.
Can any one tell me if WPF browser applications will run on MAC browsers ?
I am looking to create a website in WPF, just wanted to make sure the cross os browsers compatibility...
A newbie with WPF...
Regards
Vijay V.
Yash Softech
|
|
|
|
|
WPF Browser applications use the .net framework which will only run in windows.
There is a project called Mono[^] which allows you to run some .net applications on other platforms but it currently lacks wpf support.
Silverlight[^] is a subset of wpf which runs on multiple platforms[^].
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
i have an asp.net application which is a website. Now from aspx pages i want to redirect the user to
wpf application in the same window. How can this be done .
|
|
|
|
|
Is this a joke?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I need some helpyin developing the user control. I have developed a usercontrol for slider( which has a slider and a textbox for displaying the value ) , I need to add a user defined property orientation for my slider , based on which it should be rotated . Can anyone throw some light on how to define userdefined properties for the usercontrol.
Thanks
|
|
|
|
|
Namaste, or Vanakkum, or Namaskaram (your choice), Sri Krishnan,
I think you can get some clear responses if you make what you mean by "rotate" and "orientation" a little more clear.
What exactly is it you want to do beyond what setting the Orientation and IsDirectionReverse properties of a WPF Slider at design time do now.
If this is the very simple case of you just wanting to let your code at run-time set the Orientation property : well, write a public method in the UserControl you can call:
public void setSliderOrientation(Orientation whichWay)
{
this.slider1.Orientation = whichWay;
}
If this is the simple case of you wanting to expose the Slider Orientaton property inside a UserControl at Design Time : write a Public Property so that Property will show up in the Property Editor at Design Time :
public Orientation sliderOrientation
{
set { slider1.Orientation = value; }
get { return slider1.Orientation; }
}
If by "rotate" you mean literally rotating the user control itself, or rotating the slider inside the usercontrol : then : just go and take a look at how you can rotate anything in WPF.
best, Bill
"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844
|
|
|
|
|
equivalent method Dispose()(in c#) in WPF?
|
|
|
|
|
It's still called Dispose .
[EDIT] I don't understand why this got a 1 vote. I answered the question accurately. Just because you're using WPF doesn't mean the underlying framework has changed. It's still just .Net and C#.
"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." - Jason Jystad, 10/26/2001
modified on Sunday, July 26, 2009 3:31 PM
|
|
|
|