Click here to Skip to main content
15,891,253 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: ListViewItem promblem Pin
ABitSmart21-May-09 5:13
ABitSmart21-May-09 5:13 
GeneralRe: ListViewItem promblem Pin
mildred-frontfree21-May-09 18:14
mildred-frontfree21-May-09 18:14 
GeneralRe: ListViewItem promblem Pin
ABitSmart21-May-09 18:26
ABitSmart21-May-09 18:26 
AnswerRe: ListViewItem promblem Pin
Niladri_Biswas13-Jun-09 3:17
Niladri_Biswas13-Jun-09 3:17 
GeneralRe: ListViewItem promblem Pin
mildred-frontfree16-Jun-09 14:56
mildred-frontfree16-Jun-09 14:56 
GeneralRe: ListViewItem promblem Pin
Niladri_Biswas17-Jun-09 21:13
Niladri_Biswas17-Jun-09 21:13 
QuestionHelp getting values from combobox and comparing them to items in stackpanel Pin
Member 422055221-May-09 0:45
Member 422055221-May-09 0:45 
QuestionScrollViewer - How To Determine End of Scroll [SOLVED] Pin
#realJSOP21-May-09 0:32
mve#realJSOP21-May-09 0:32 
I've successfully created a scrolling tab control, and I've figured out how to grab the ScrollViewer control (in the .cs file) that handles scrolling the tabs, but I haven't been able to find a solution to the following issue.

I want the repeat buttons (that the user uses to scroll the tabs) to be enabled/disabled based on the current state of tab control. My goal is to enable/disable the repeat buttons based on several criteria:

0) If there are not enough tabs to require scrolling, both buttons are disabled. Otherwise the buttons are enabled (see next couple of requirements).

1) If the first tab item is in view, the left (prev) button is disabled.

2) If the last tab item is in view, the right (next) button is disabled.

The ScrollViewer wraps a StackPanel. As tabs are added to the TabControl, there is no obvious change to any of the properties that one would expect to indicate that scrolling is required to see additional items. It seems to me that *something* should change somewhere, but I'm not seeing it.

My first attempt at figuring this out included programatically adding tab items and watching the ScrollViewer (and the StackPanel) under the debugger, and that's when I discovered that none of the obvious values are changing as tabs are added.

It seems to me that this should be able to be handled in the XAML, and I think I would rather do it there, but I am not a WPF "purist", and am more than willing to implement a "code-behind" (god, I hate that term) solution.

I can post code if it's desired, but I didn't want to waste my time or yours with the relatively huge amounts of code that need to be posted for WPF questions. Can anyone help?

---------------

Solved - In the CS file, get the scroller from the tab control, get the buttons from the scroller, and add event handlers to manipulate their enabled status'. If there's a XAML way to do this, I couldn't find it.


"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 Monday, June 1, 2009 5:05 PM

AnswerRe: ScrollViewer - How To Determine End of Scroll Pin
Pete O'Hanlon22-May-09 0:52
mvePete O'Hanlon22-May-09 0:52 
GeneralRe: ScrollViewer - How To Determine End of Scroll Pin
#realJSOP22-May-09 8:54
mve#realJSOP22-May-09 8:54 
GeneralRe: ScrollViewer - How To Determine End of Scroll Pin
#realJSOP1-Jun-09 11:09
mve#realJSOP1-Jun-09 11:09 
QuestionNo get device context Pin
krishnan.s20-May-09 15:26
krishnan.s20-May-09 15:26 
AnswerRe: No get device context Pin
Mark Salsbery20-May-09 15:49
Mark Salsbery20-May-09 15:49 
GeneralRe: No get device context Pin
krishnan.s21-May-09 0:22
krishnan.s21-May-09 0:22 
GeneralRe: No get device context Pin
Mark Salsbery21-May-09 5:45
Mark Salsbery21-May-09 5:45 
QuestionGettting metadata from TIFF file fails Pin
fjparisIII20-May-09 12:09
fjparisIII20-May-09 12:09 
AnswerRe: Gettting metadata from TIFF file fails Pin
Mark Salsbery20-May-09 15:45
Mark Salsbery20-May-09 15:45 
GeneralRe: Gettting metadata from TIFF file fails (RESOLVED!) Pin
fjparisIII20-May-09 16:46
fjparisIII20-May-09 16:46 
GeneralRe: Gettting metadata from TIFF file fails (RESOLVED!) Pin
Mark Salsbery20-May-09 17:15
Mark Salsbery20-May-09 17:15 
GeneralRe: Gettting metadata from TIFF file fails (RESOLVED!) Pin
fjparisIII21-May-09 12:33
fjparisIII21-May-09 12:33 
QuestionMessage Removed Pin
20-May-09 4:15
professionalN_tro_P20-May-09 4:15 
AnswerMessage Removed Pin
20-May-09 8:00
professionalN_tro_P20-May-09 8:00 
GeneralRe: Remove Selection of Listbox Inside of a Template Pin
#realJSOP20-May-09 8:11
mve#realJSOP20-May-09 8:11 
GeneralMessage Removed Pin
20-May-09 8:18
professionalN_tro_P20-May-09 8:18 
GeneralRe: Remove Selection of Listbox Inside of a Template Pin
Mark Salsbery20-May-09 10:35
Mark Salsbery20-May-09 10:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.